#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, n, m, a[50], b[50], c[50], d[50];
  cin >> n >> m;
  for (i = 0; i < n; i++) cin >> a[i] >> b[i];
  for (i = 0; i < m; i++) cin >> c[i] >> d[i];
  int cp, dis, dmin;
  for (int i = 0; i < n; i++) {
    dmin = 1000000007;
    for (int j = n - 1; j > -1; j--) {
      dis = fabs(c[j] - a[i]) + fabs(d[j] - b[i]);
      if (dis <= dmin) {
        dmin = dis;
        cp = j + 1;
      }
    }
    cout << cp << endl;
  }
  return 0;
}
