#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  int A[50][50], B[50][50], res[50];
  int distance;
  int minimum = 10000000;
  cin >> N >> M;
  for (int i = 0; i < N; i++) cin >> A[i][0] >> A[i][1];
  for (int i = 0; i < M; i++) cin >> B[i][0] >> B[i][1];
  for (int i = 0; i < N; i++) {
    minimum = 10000000;
    for (int j = 0; j < N; j++) {
      distance = abs(A[i][0] - B[j][0]) + abs(A[i][1] - B[j][1]);
      if (distance < minimum) {
        minimum = distance;
        res[i] = j + 1;
      }
    }
  }
  for (int i = 0; i < N; i++) cout << res[i] << endl;
  return 0;
}
