#include <bits/stdc++.h>
using namespace std;
const int N = 10010;
const double eps = 1e-12;
struct point {
  int x, y, op, id;
  int u, v;
  long long operator*(const point &r) const {
    return (long long)u * r.v - (long long)v * r.u;
  }
} a[N << 1], s;
int n;
int ans[N];
inline bool cmp(point x, point y) { return x * y > 0; }
inline void solve(int l, int r) {
  if (l > r) return;
  for (int k = l; k <= r; k++)
    if (a[k].y < a[l].y || (a[k].y == a[l].y && a[k].x < a[l].x))
      swap(a[l], a[k]);
  for (int k = l; k <= r; k++) {
    a[k].u = a[k].x - a[l].x;
    a[k].v = a[k].y - a[l].y;
  }
  sort(a + l + 1, a + r + 1, cmp);
  int x = 0, y = 0, mid = 0;
  for (int k = l; k <= r; k++) {
    if (a[k].op == 0)
      x++;
    else
      y++;
    if (x == y && a[k].op != a[l].op &&
        max(k - l - 1, r - k) < max(mid - l - 1, r - mid))
      mid = k;
  }
  if (a[l].op == 0)
    ans[a[l].id] = a[mid].id;
  else
    ans[a[mid].id] = a[l].id;
  solve(l + 1, mid - 1), solve(mid + 1, r);
  return;
}
int main() {
  scanf("%d", &n);
  for (int k = 1; k <= n; k++) {
    scanf("%d%d", &a[k].x, &a[k].y);
    a[k].op = 0;
    a[k].id = k;
  }
  for (int k = 1; k <= n; k++) {
    scanf("%d%d", &a[k + n].x, &a[k + n].y);
    a[k + n].op = 1;
    a[k + n].id = k;
  }
  solve(1, 2 * n);
  for (int k = 1; k <= n; k++) printf("%d\n", ans[k]);
  return 0;
}
