#include <bits/stdc++.h>
using namespace std;
int used[55];
int main() {
  memset(used, -1, sizeof(used));
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int N, M;
  cin >> N >> M;
  vector<int> a(N, 0), b(N, 0);
  for (int i = 0; i < (N); ++i) {
    cin >> a[i] >> b[i];
  }
  vector<int> c(M, 0), d(M, 0);
  for (int i = 0; i < (M); ++i) {
    cin >> c[i] >> d[i];
  }
  map<int, int> cp;
  cp.clear();
  for (int i = 0; i < (N); ++i) {
    int cand = -1;
    int maxL = (int)1e9;
    for (int j = 0; j < (M); ++j) {
      int curr = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (used[j] == -1 && curr < maxL) {
        maxL = curr;
        cand = j;
      }
    }
    used[cand] = i;
    cp[i + 1] = cand + 1;
  }
  for (int i = 0; i < (N); ++i) {
    cout << cp[i + 1] << endl;
  }
  return 0;
}
