#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M, d, r, ans, key, A[60], B[60], C[60], D[60];
  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 < N; i++) {
    key = 100000000;
    for (int j = 0; j < M; j++) {
      d = abs(C[i] - A[j]);
      r = abs(D[i] - B[j]);
      if (d + r < key) {
        key = d + r;
        ans = j + 1;
      }
    }
    cout << ans << endl;
  }
  return 0;
}
