#include <bits/stdc++.h>
using namespace std;
int Read() {
  char c = getchar();
  while (c < '0' || c > '9') c = getchar();
  int t = c - '0';
  c = getchar();
  while (c >= '0' && c <= '9') t = (t << 3) + (t << 1) + c - '0', c = getchar();
  return t;
}
struct Node {
  long long x, y;
  int bh, col;
  Node(long long a = 0, long long b = 0) : x(a), y(b) {}
};
Node operator+(Node a, Node b) { return Node(a.x + b.x, a.y + b.y); }
Node operator-(Node a, Node b) { return Node(a.x - b.x, a.y - b.y); }
int Zero(long long k) {
  if (k > 0)
    return 1;
  else if (k < 0)
    return -1;
  else
    return 0;
}
long long Cross(Node a, Node b) { return a.x * b.y - a.y * b.x; }
bool cmp(const Node& t1, const Node& t2) { return Zero(Cross(t1, t2)) > 0; }
Node a[20001];
int n;
int ans[10001];
void dfs(int l, int r) {
  if (l > r) return;
  if (l + 1 == r) {
    if (a[l].col == 0)
      ans[a[l].bh] = a[r].bh - n;
    else
      ans[a[r].bh] = a[l].bh - n;
    return;
  }
  int t = l;
  for (int i = l + 1; i <= r; i++) {
    if (a[i].x < a[t].x || (a[i].x == a[t].x && a[i].y < a[t].y)) t = i;
  }
  swap(a[r], a[t]);
  for (int i = l; i < r; i++) a[i].x -= a[r].x, a[i].y -= a[r].y;
  sort(a + l, a + r, cmp);
  for (int i = l; i < r; i++) a[i].x += a[r].x, a[i].y += a[r].y;
  int c[2];
  c[0] = c[1] = 0;
  for (int i = l; i < r; i++) {
    if (a[i].col != a[r].col && c[0] == c[1]) {
      if (a[i].col == 0)
        ans[a[i].bh] = a[r].bh - n;
      else
        ans[a[r].bh] = a[i].bh - n;
      dfs(l, i - 1);
      dfs(i + 1, r - 1);
      break;
    }
    c[a[i].col]++;
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++)
    scanf("%lld%lld", &a[i].x, &a[i].y), a[i].col = 0;
  for (int i = n + 1; i <= n + n; i++)
    scanf("%lld%lld", &a[i].x, &a[i].y), a[i].col = 1;
  for (int i = 1; i <= n + n; i++) a[i].bh = i;
  dfs(1, n + n);
  for (int i = 1; i <= n; i++) printf("%d\n", ans[i]);
  return 0;
}
