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;
namespace X {
struct Point {
  int x, y;
  Point(int x = 0, int y = 0) : x(x), y(y) {}
};
Point operator+(const Point& a, const Point& b) {
  return Point(a.x + b.x, a.y + b.y);
}
Point operator-(const Point& a, const Point& b) {
  return Point(a.x - b.x, a.y - b.y);
}
int dcmp(int x) {
  if (x == 0) return 0;
  return x < 0 ? -1 : 1;
}
bool operator==(const Point& a, const Point& b) {
  return dcmp(a.x - b.x) == 0 && dcmp(a.y - b.y) == 0;
}
double cross(const Point& a, const Point& b) { return a.x * b.y - a.y * b.x; }
};  // namespace X
using namespace X;
Point p[20100];
int an[10100];
int d[20100], tmp[20100];
int n;
double ang[20100];
bool vis[20100];
bool c1(int a, int b) { return ang[a] < ang[b]; }
bool c2(int a, int b) {
  return p[a].x < p[b].x || (p[a].x == p[b].x && p[a].y < p[b].y);
}
void solve(int l, int r) {
  if (r < l) return;
  swap(*min_element(d + l, d + r + 1, c2), d[l]);
  int i;
  for (i = l + 1; i <= r; i++)
    ang[d[i]] = atan2(p[d[i]].y - p[d[l]].y, p[d[i]].x - p[d[l]].x);
  sort(d + l + 1, d + r + 1, c1);
  int len = r - l, a[] = {0, 0}, nl, nr;
  for (nl = l + 1, nr = l; nl <= r; nl++) {
    while (nr < nl ||
           (nr - nl + 1 < len && cross(p[d[(nr - l) % len + l + 1]] - p[d[l]],
                                       p[d[nl]] - p[d[l]]) < 0)) {
      ++nr;
      a[d[(nr - l - 1) % len + l + 1] <= n]++;
    }
    a[d[nl] <= n]--;
    if (int(d[nl] <= n) + (d[l] <= n) == 1 && a[0] == a[1]) break;
  }
  if (d[l] <= n)
    an[d[l]] = d[nl];
  else
    an[d[nl]] = d[l];
  for (i = l + 1; i <= r; i++) vis[i] = 0;
  vis[nl] = 1;
  tmp[0] = 0;
  for (i = nl + 1; i <= nr; i++) {
    vis[(i - l - 1) % len + l + 1] = 1;
    tmp[++tmp[0]] = d[(i - l - 1) % len + l + 1];
  }
  int t1 = l;
  for (i = l + 1; i <= r; i++)
    if (!vis[i]) {
      d[++t1] = d[i];
    }
  int t2 = t1;
  for (i = 1; i <= tmp[0]; i++) d[++t2] = tmp[i];
  solve(l + 1, t1);
  solve(t1 + 1, t2);
}
int main() {
  int i;
  while (scanf("%d", &n) == 1) {
    for (i = 1; i <= 2 * n; i++) scanf("%d%d", &p[i].x, &p[i].y);
    for (i = 1; i <= 2 * n; i++) d[i] = i;
    solve(1, 2 * n);
    for (i = 1; i <= n; i++) printf("%d\n", an[i] - n);
  }
  return 0;
}