#include <bits/stdc++.h>
using namespace std;
const int N = 2e4 + 2;
int d[N], mat[N];
struct TPoint {
  int x, y;
  bool col;
} p[N];
bool ccw(TPoint a, TPoint b, TPoint c) {
  return (b.x - a.x) * (c.y - a.y) - (c.x - a.x) * (b.y - a.y) > 0;
}
bool cw(TPoint a, TPoint b, TPoint c) {
  return (b.x - a.x) * (c.y - a.y) - (c.x - a.x) * (b.y - a.y) < 0;
}
bool ccw(int a, int b, int c) { return ccw(p[a], p[b], p[c]); }
bool cw(int a, int b, int c) { return cw(p[a], p[b], p[c]); }
bool ConvexHull(int l, int r) {
  vector<int> up(1, d[l]), lo(1, d[l]);
  for (int i = l + 1; i <= r; ++i) {
    if (i == r || cw(d[l], d[i], d[r])) {
      while (up.size() > 1 && !cw(up[up.size() - 2], up.back(), d[i]))
        up.pop_back();
      up.push_back(d[i]);
    }
    if (i == r || ccw(d[l], d[i], d[r])) {
      while (lo.size() > 1 && !ccw(lo[lo.size() - 2], lo.back(), d[i]))
        lo.pop_back();
      lo.push_back(d[i]);
    }
  }
  reverse(lo.begin(), lo.end());
  up.insert(up.end(), lo.begin() + 1, lo.end() - 1);
  bool matched = false;
  int n = up.size();
  for (int i = 0; i < n; ++i) {
    int u = up[i], v = up[(i + 1) % n];
    if (p[u].col != p[v].col && mat[u] == -1 && mat[v] == -1) {
      matched = true;
      mat[u] = v;
      mat[v] = u;
    }
  }
  return matched;
}
void Solve(int l, int r) {
  if (l > r) return;
  if (ConvexHull(l, r)) {
    return Solve(l, stable_partition(d + l, d + r + 1,
                                     [](int x) { return mat[x] == -1; }) -
                        d - 1);
  } else
    for (int i = l, sum = 0; i <= r; ++i) {
      sum += p[d[i]].col ? -1 : 1;
      if (sum == 0) {
        Solve(l, i);
        Solve(i + 1, r);
        return;
      }
    }
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n + n; ++i) {
    int x, y;
    cin >> x >> y;
    p[i] = {x, y, i < n};
    d[i] = i;
  }
  sort(d, d + n * 2, [&](int lhs, int rhs) { return p[lhs].x < p[rhs].x; });
  fill(mat, mat + n * 2, -1);
  Solve(0, n * 2 - 1);
  for (int i = 0; i < n; ++i) cout << mat[i] - n + 1 << '\n';
  return 0;
}
