#include <bits/stdc++.h>
using namespace std;
int n;
struct P {
  long long x, y;
  int id;
  bool base;
  P operator-(const P &a) const { return (P){x - a.x, y - a.y, -1, 0}; }
  long long operator*(const P &a) const { return x * a.y - y * a.x; }
};
vector<P> des;
vector<int> ship;
void solve(int l, int r) {
  if (l > r) return;
  sort(des.begin() + l, des.begin() + r + 1,
       [&](const P &a, const P &b) { return (a.y < b.y); });
  sort(des.begin() + l + 1, des.begin() + r + 1,
       [&](const P &a, const P &b) { return (a - des[l]) * (b - des[l]) < 0; });
  int cur = 1, res;
  for (int i = l + 1; i <= r; i++) {
    if (des[i].base != des[l].base)
      cur--;
    else
      cur++;
    if (cur == 0) {
      res = i;
      if (des[i].base == 0)
        ship[des[i].id] = des[l].id;
      else
        ship[des[l].id] = des[i].id;
      break;
    }
  }
  solve(l + 1, res - 1);
  solve(res + 1, r);
}
void rot(long long &x, long long &y, int c, int s) {
  long long new_x = x * c + y * s;
  long long new_y = x * -s + y * c;
  x = new_x;
  y = new_y;
}
int main() {
  srand(time(0));
  int c = rand() % 100;
  int s = rand() % 100;
  scanf("%d", &n);
  des.resize(2 * n);
  ship.resize(n);
  for (int i = 0; i < n; i++) {
    scanf("%lld%lld", &des[i].x, &des[i].y);
    rot(des[i].x, des[i].y, c, s);
    ;
    des[i].id = i;
    des[i].base = 0;
  }
  for (int i = 0; i < n; i++) {
    scanf("%lld%lld", &des[i + n].x, &des[i + n].y);
    rot(des[i + n].x, des[i + n].y, c, s);
    des[i + n].id = i;
    des[i + n].base = 1;
  }
  solve(0, 2 * n - 1);
  for (int i = 0; i < n; i++) printf("%d\n", ship[i] + 1);
  return 0;
}
