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