#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, a[50], b[50], c[50], d[50], mi, ni;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> b[i];
  }
  for (int i = 0; i < m; i++) {
    cin >> c[i] >> d[i];
  }
  for (int i = 0; i < m - 1; i++) {
    for (int j = 0; j < m - i - 1; j++) {
      if (c[j] > c[j + 1]) {
        mi = c[j];
        c[j] = c[j + 1];
        c[j + 1] = mi;
        mi = d[j];
        d[j] = d[j + 1];
        d[j + 1] = mi;
      } else if (d[j] > d[j + 1] && c[j] == c[j + 1]) {
        mi = c[j];
        c[j] = c[j + 1];
        c[j + 1] = mi;
        mi = d[j];
        d[j] = d[j + 1];
        d[j + 1] = mi;
      }
    }
  }
  mi = 199999999;
  for (int i = 0; i < n; i++) {
    ni = 0;
    for (int j = 0; j < m; j++) {
      if ((abs(a[i] - c[j]) + abs(b[i] - d[j])) < mi) {
        mi = abs(a[i] - c[j]) + abs(b[i] - d[j]);
        ni = j;
      }
    }
    cout << ni + 1 << endl;
  }
  return 0;
}
