#include <bits/stdc++.h>
using namespace std;
using lint = long long int;
struct pt {
  lint x, y;
  bool isbase;
  int idx;
  bool operator<(const pt &ref) const {
    if (x == ref.x)
      return y < ref.y;
    else
      return x < ref.x;
  }
};
lint ccw(const pt &a, const pt &b, const pt &c) {
  return a.x * b.y + b.x * c.y + c.x * a.y - a.y * b.x - b.y * c.x - c.y * a.x;
}
const int MAX_N = 1e4;
pt arr[MAX_N * 2];
int res[MAX_N * 2];
void solve(int i, int j) {
  if (i + 1 == j) {
    res[arr[i].idx] = arr[j].idx;
    res[arr[j].idx] = arr[i].idx;
    return;
  } else if (i > j)
    return;
  swap(arr[i], *min_element(arr + i, arr + j + 1));
  sort(arr + i + 1, arr + j + 1, [&](const pt &a, const pt &b) {
    lint ccw_val = ccw(arr[i], a, b);
    return (ccw_val > 0);
  });
  int cnt[2] = {0, 0};
  int t = i - 1;
  int mid = (i + j) / 2;
  for (int k = i + 1; k <= j; k++) {
    if (cnt[0] == cnt[1] && arr[i].isbase != arr[k].isbase) {
      if (abs(mid - t) >= abs(mid - k)) {
        t = k;
        break;
      }
    }
    cnt[arr[k].isbase]++;
  }
  res[arr[i].idx] = arr[t].idx;
  res[arr[t].idx] = arr[i].idx;
  solve(i + 1, t - 1);
  solve(t + 1, j);
}
int main(void) {
  ios_base::sync_with_stdio(false), cin.tie(NULL);
  int N;
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> arr[i].x >> arr[i].y;
    arr[i].isbase = false;
    arr[i].idx = i;
  }
  for (int i = N; i < N + N; i++) {
    cin >> arr[i].x >> arr[i].y;
    arr[i].isbase = true;
    arr[i].idx = i;
  }
  solve(0, 2 * N - 1);
  for (int i = 0; i < N; i++) {
    cout << res[i] - N + 1 << '\n';
  }
}
