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