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