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 = 2e4;
struct point {
  int x, y;
  int id;
  point(int a = 0, int b = 0, int c = 0) {
    x = a;
    y = b;
    id = c;
  }
  void sc(int i) {
    scanf("%d%d", &x, &y);
    id = i;
  }
  double ang() { return atan2(y, x); }
  double angdeg() {
    double ret = 180 * atan2(y, x) / acos(-1);
    if (ret < 0) ret += 360;
    return ret;
  }
  point normal() { return point(x / len(), y / len()); }
  double len() { return sqrt(y * y + x * x); }
  point operator+(const point &a) { return point(x + a.x, y + a.y); }
  point operator-(const point &a) { return point(x - a.x, y - a.y); }
  int operator*(const point &a) { return a.x * x + a.y * y; }
  long long operator^(const point &a) { return x * a.y - a.x * y; }
  bool operator<(point b) {
    if (x != b.x) return x < b.x;
    return y < b.y;
  }
  double dis(point a) {
    return sqrt((x - a.x) * (x - a.x) + (y - a.y) * (y - a.y));
  }
} a[N];
double PointToLine(point a, point b, point c, bool seg) {
  if (seg && (((c - a) * (b - a)) < 0 || ((c - b) * (a - b)) < 0))
    return min((c - a).len(), (c - b).len());
  return abs((c - a) ^ (b - a)) / (b - a).len();
}
vector<point> ConvexHull(point *a, int n) {
  vector<point> ret;
  int at = 0;
  for (int i = 0; i < n; i++)
    if (a[i].x < a[at].x)
      at = i;
    else if (a[i].x == a[at].x && a[i].y < a[at].y)
      at = i;
  swap(a[0], a[at]);
  sort(a + 1, a + n, [&a](point x, point y) {
    x = x - a[0];
    y = y - a[0];
    long long temp = x ^ y;
    if (!temp) return x.len() < y.len();
    return temp < 0;
  });
  ret.push_back(a[0]);
  for (int j = 1; j < n; j++) {
    while (ret.size() > 1) {
      point one = ret.back() - ret[ret.size() - 2];
      point two = a[j] - ret[ret.size() - 2];
      if ((one ^ two) < 0) break;
      ret.pop_back();
    }
    ret.push_back(a[j]);
  }
  return ret;
}
int n, ans[N];
void solve(int l, int r) {
  if (r - l < 1) return;
  if (r - l == 1) {
    ans[min(a[l].id, a[r].id)] = max(a[l].id, a[r].id) - n + 1;
    return;
  }
  int at = l;
  for (int i = l + 1; i <= r; i++)
    if (a[i] < a[at]) at = i;
  swap(a[l], a[at]);
  sort(a + l + 1, a + r + 1, [&](point x, point y) {
    x = x - a[l];
    y = y - a[l];
    return (x ^ y) < 0;
  });
  int sum = 0, id = l;
  for (int i = l + 1; i <= r; i++) {
    if (a[i].id < n && a[l].id < n || a[i].id >= n && a[l].id >= n)
      sum++;
    else
      sum--;
    if (sum == -1 &&
        (abs((r + l) / 2 - i) < abs((r + l) / 2 - id) || id == l) &&
        (a[i].id < n && a[l].id >= n || a[i].id >= n && a[l].id < n))
      id = i;
  }
  ans[min(a[l].id, a[id].id)] = max(a[id].id, a[l].id) - n + 1;
  solve(l + 1, id - 1);
  solve(id + 1, r);
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n + n; i++) a[i].sc(i);
  solve(0, n + n - 1);
  for (int i = 0; i < n; i++) printf("%d\n", ans[i]);
}