#include <bits/stdc++.h>
using namespace std;
const int N = 2e4 + 7;
int n;
int ans[N];
struct pkt {
  int x, y, col, ind;
  bool operator<(const pkt &a) const {
    if (x == a.x)
      return y < a.y;
    else
      return x < a.x;
  }
  bool operator==(const pkt &a) const { return x == a.x && y == a.y; }
};
bool prawo(pkt &a, pkt &b, pkt &c) {
  return (a.x - c.x) * (b.y - c.y) - (b.x - c.x) * (a.y - c.y) > 0;
}
pkt p[N];
vector<pkt> hull(vector<pkt> &p) {
  vector<pkt> u, l;
  sort((p).begin(), (p).end());
  for (auto it : p) {
    while (u.size() >= 2 && !prawo(it, u.back(), u[u.size() - 2])) u.pop_back();
    u.push_back(it);
  }
  reverse((p).begin(), (p).end());
  for (auto it : p) {
    while (l.size() >= 2 && !prawo(it, l.back(), l[l.size() - 2])) l.pop_back();
    l.push_back(it);
  }
  u.pop_back();
  l.pop_back();
  u.insert(u.end(), (l).begin(), (l).end());
  return u;
}
pkt curr;
bool comp(pkt a, pkt b) { return prawo(a, b, curr); }
vector<pkt> sortuj(vector<pkt> p, pkt &s) {
  curr = s;
  sort((p).begin(), (p).end(), comp);
  return p;
}
void match(pkt &a, pkt &b) {
  if (a.col != 1) swap(a, b);
  ans[a.ind] = b.ind;
}
void solve(vector<pkt> &p) {
  if (p.empty()) return;
  if (p.size() == 2) {
    match(p[0], p[1]);
    return;
  }
  vector<pkt> h = hull(p);
  random_shuffle((h).begin(), (h).end());
  for (auto &it : p) {
    if (it == h[0]) {
      swap(it, p.back());
      p.pop_back();
      break;
    }
  }
  p = sortuj(p, h[0]);
  int cnt[] = {0, 0};
  for (int i = 0; i < p.size(); ++i) {
    auto it = p[i];
    ++cnt[it.col];
    if (cnt[h[0].col ^ 1] == cnt[h[0].col] + 1 && it.col == h[0].col ^ 1) {
      match(h[0], it);
      vector<pkt> l, r;
      for (int j = 0; j < i; ++j) {
        l.push_back(p[j]);
      }
      for (int j = i + 1; j < p.size(); ++j) {
        r.push_back(p[j]);
      }
      solve(l);
      solve(r);
      return;
    }
  }
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cin >> n;
  vector<pkt> s;
  for (int i = 1; i <= n; ++i) {
    cin >> p[i].x >> p[i].y;
    p[i].ind = i;
    p[i].col = 1;
    s.push_back(p[i]);
  }
  for (int i = n + 1; i <= 2 * n; ++i) {
    cin >> p[i].x >> p[i].y;
    p[i].ind = i - n;
    p[i].col = 0;
    s.push_back(p[i]);
  }
  srand(24);
  solve(s);
  for (int i = 1; i <= n; ++i) {
    cout << ans[i] << '\n';
  }
}
