#include <bits/stdc++.h>
using namespace std;
bool debug = 0;
int n, m, k;
int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};
string direc = "RDLU";
long long ln, lk, lm;
void etp(bool f = 0) {
  puts(f ? "YES" : "NO");
  exit(0);
}
void addmod(int& x, int y, int mod = 1000000007) {
  assert(y >= 0);
  x += y;
  if (x >= mod) x -= mod;
  assert(x >= 0 && x < mod);
}
void et() {
  puts("-1");
  exit(0);
}
long long fastPow(long long x, long long y, int mod = 1000000007) {
  long long ans = 1;
  while (y > 0) {
    if (y & 1) ans = (x * ans) % mod;
    x = x * x % mod;
    y >>= 1;
  }
  return ans;
}
long long gcd1(long long x, long long y) {
  long long z = y;
  while (x % y != 0) {
    z = x % y;
    x = y;
    y = z;
  }
  return z;
}
struct Point {
  long long x, y;
  int tp;
  Point() {}
  Point(long long x, long long y) : x(x), y(y) {}
  long double abs() const { return hypot(x, y); }
  long double arg() const { return atan2(y, x); }
  Point operator*(double o) const { return Point(x * o, y * o); }
  Point operator+(const Point& o) const { return Point(x + o.x, y + o.y); }
  Point operator-(const Point& o) const { return Point(x - o.x, y - o.y); }
  Point operator/(double o) const { return Point(x / o, y / o); }
  bool operator<(const Point& o) const {
    return x < o.x - 1e-9 || (x < o.x + 1e-9 && y < o.y - 1e-9);
  }
  friend bool operator==(const Point& r1, const Point& r2) {
    return r1.x == r2.x && r1.y == r2.y;
  }
  long long cross(Point b) const { return x * b.y - b.x * y; }
  void readin() { scanf("%lld%lld", &x, &y); }
} p[20105], C;
int ans[20105];
int cmp(Point a, Point b) {
  Point x = a - C, y = b - C;
  return x.x * y.y < x.y * y.x;
}
void cal(int l, int r) {
  if (r < l) return;
  int z = min_element(p + l, p + r + 1) - p;
  swap(p[l], p[z]);
  C = p[l];
  sort(p + l + 1, p + r + 1, cmp);
  int cc[2] = {0, 0};
  int i;
  for (i = l; i <= r; i++) {
    int T = p[i].tp <= n;
    cc[T]++;
    if (cc[0] == cc[1]) {
      break;
    }
  }
  if (p[i].tp <= n)
    ans[p[i].tp] = C.tp;
  else
    ans[C.tp] = p[i].tp;
  cal(l + 1, i - 1);
  cal(i + 1, r);
}
void fmain(int ID) {
  scanf("%d", &n);
  for (int(i) = 1; (i) <= (int)(n + n); (i)++) {
    p[i].readin();
    p[i].tp = i;
  }
  cal(1, n + n);
  for (int(i) = 1; (i) <= (int)(n); (i)++) printf("%d\n", ans[i] - n);
}
int main() {
  int t = 1;
  for (int(i) = 1; (i) <= (int)(t); (i)++) {
    fmain(i);
  }
  return 0;
}
