Problem: Now that Heidi knows that she can assign Rebel spaceships to bases (recall the easy subtask), she is asking you: how exactly to do this? Now, given positions of N spaceships and N bases on a plane, your task is to connect spaceships and bases with line segments so that: 

  * The segments do not intersect. 
  * Such a connection forms a perfect matching. 

Input

The first line contains an integer N (1 ≤ n ≤ 10000). For 1 ≤ i ≤ N, the i + 1-th line contains two integers xi and yi (|xi|, |yi| ≤ 10000) denoting the coordinates of the i-th spaceship. The following N lines have the same format, denoting the position of bases. It is guaranteed that no two points coincide and no three points are on the same line.

Output

The output should have N lines. The i-th line should contain an integer pi, the index of the base to which the i-th spaceship is connected. The sequence p1, ..., pN should form a permutation of 1, ..., N.

It is guaranteed that a solution exists. If there are multiple solutions, you can output any one of them.

Example

Input

4
6 6
5 1
2 4
4 0
5 4
1 2
2 1
3 5


Output

4
1
2
3

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const int N = 10005;
int n;
int match[N + N];
struct Point {
  int x;
  int y;
  int type;
  int id;
  Point(int x = 0, int y = 0) : x(x), y(y), type(0), id(0) {}
  bool operator<(const Point &other) const {
    return x < other.x || (x == other.x && y < other.y);
  }
} a[N + N], b[N + N];
Point pivot = Point();
long long cross(Point p, Point q) { return 1LL * p.x * q.y - 1LL * q.x * p.y; }
bool cmp(Point p, Point q) {
  bool fp = pivot < p;
  bool fq = pivot < q;
  if (fp != fq) return fp > fq;
  return cross(p, q) >= 0;
}
inline void solve(int l, int r) {
  assert((r - l) % 2 == 0);
  if (r - l == 0) return;
  Point root = a[l];
  for (int i = l; i < r; ++i) {
    if (a[i] < root) {
      root = a[i];
    }
  }
  for (int i = l; i < r; ++i) {
    a[i].x -= root.x, a[i].y -= root.y;
  }
  for (int i = l; i < r; ++i) {
    if (a[i].x == 0 && a[i].y == 0) {
      for (int j = i + 1; j < r; ++j) {
        a[j - 1] = a[j];
      }
      --r;
    }
  }
  sort(a + l, a + r, cmp);
  int cur = 0;
  int ptr = 0;
  vector<int> can;
  int sz = r - l;
  for (int i = 0; i < sz; ++i) {
    while (cross(a[i + l], a[ptr + l]) >= 0) {
      cur += (a[ptr + l].type == root.type ? -1 : +1);
      ptr = (ptr + 1) % sz;
      if (ptr == i) break;
    }
    if (a[i + l].type != root.type && cur == +1) {
      can.push_back(i);
    }
    cur -= (a[i + l].type == root.type ? -1 : +1);
  }
  int pos = can[rand() % (int)can.size()];
  match[root.id] = a[pos + l].id;
  match[a[pos + l].id] = root.id;
  Point w = a[pos + l];
  int low_lef = l, high_lef = l;
  for (int i = 0; i < sz; ++i) {
    if (i == pos) continue;
    if (cross(w, a[i + l]) >= 0) b[high_lef++] = a[i + l];
  }
  int low_rig = high_lef, high_rig = high_lef;
  for (int i = 0; i < sz; ++i) {
    if (i == pos) continue;
    if (cross(w, a[i + l]) < 0) b[high_rig++] = a[i + l];
  }
  for (int i = low_lef; i < high_rig; ++i) a[i] = b[i];
  solve(low_lef, high_lef);
  solve(low_rig, high_rig);
}
int main() {
  srand(time(NULL));
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin.tie(0);
  cin >> n;
  vector<Point> vec;
  for (int i = 1; i <= n + n; ++i) {
    cin >> a[i - 1].x >> a[i - 1].y, a[i - 1].type = (i <= n), a[i - 1].id = i;
  }
  solve(0, n + n);
  for (int i = 1; i <= n; ++i) {
    printf("%d\n", match[i] - n);
  }
}