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