#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<double> a(n), b(n), c(m), d(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];
  }
  int ans = 0;
  double dis, mini = 10000001;
  for (int i = 0; i < n; i++) {
    ans = 0;
    mini = 10000001;
    for (int j = 0; j < m; j++) {
      dis = fabs(a[i] - c[j]) + fabs(b[i] - d[j]);
      if (dis < mini) {
        ans = j;
      }
      mini = min(dis, mini);
    }
    cout << ans + 1 << endl;
  }
  return 0;
}
