#include <bits/stdc++.h>
#pragma GCC optimize "-O3"
using namespace std;
const int N = 1e4 + 2;
int n, p[N];
pair<pair<int, int>, pair<int, int> > a[N + N];
pair<pair<int, int>, pair<int, int> > C;
bool cmp(pair<pair<int, int>, pair<int, int> > a,
         pair<pair<int, int>, pair<int, int> > b) {
  return (a.first.first - C.first.first) * (C.first.second - b.first.second) >
         (b.first.first - C.first.first) * (C.first.second - a.first.second);
}
void solve(int l, int r) {
  if (l > r) return;
  int j = min_element(a + l, a + r + 1) - a;
  swap(a[l], a[j]);
  C = a[l];
  sort(a + l + 1, a + r + 1, cmp);
  int ptr = r, sum = 0;
  while (C.second.first == a[ptr].second.first || sum != 0) {
    sum += (C.second.first == a[ptr].second.first ? 1 : -1);
    ptr--;
  }
  if (C.second.first)
    p[a[ptr].second.second] = C.second.second - n;
  else
    p[C.second.second] = a[ptr].second.second - n;
  solve(l + 1, ptr - 1);
  solve(ptr + 1, r);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 1; i <= 2 * n; ++i) {
    int x, y;
    cin >> x >> y;
    a[i] = pair<pair<int, int>, pair<int, int> >({x, y}, {i > n, i});
  }
  solve(1, n << 1);
  for (int i = 1; i <= n; ++i) cout << p[i] << "\n";
}
