#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  vector<long> 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];
  for (int i = 0; i < N; i++) {
    long min_d = 101, min_num = M + 1;
    for (int j = 0; j < M; j++) {
      long dis = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (dis < min_d) {
        min_d = dis;
        min_num = j + 1;
      } else if (dis == min_d) {
        if (j + 1 < min_num) min_num = j + 1;
      }
    }
    cout << min_num << endl;
  }
  return 0;
}
