#include <bits/stdc++.h>
int x[55], y[55];
int mdist(int a, int b) { return fabs(x[a] - x[b]) + fabs(y[a] - y[b]); }
using namespace std;
int main() {
  int n, m;
  int mind;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m + n; i++) {
    cin >> x[i] >> y[i];
  }
  for (int k = 1; k <= n; k++) {
    mind = 1e9;
    for (int j = n + 1; j <= m + n; j++) {
      mind = min(mind, mdist(k, j));
    }
    for (int j = n + 1; j <= m + n; j++)
      if (mdist(k, j) == mind) {
        cout << j - n << endl;
        break;
      }
  }
  return 0;
}
