#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(M);
  vector<int> D(M);
  vector<int> E(N);
  vector<int> F(N);
  for (int i = 0; i < N; i++) {
    cin >> A.at(i) >> B.at(i);
    E.at(i) = 100000000;
  }
  for (int i = 0; i < M; i++) {
    cin >> C.at(i) >> D.at(i);
  }
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < M; j++) {
      if (E.at(i) > abs(A.at(i) - C.at(j)) + abs(B.at(i) - D.at(j))) {
        E.at(i) = abs(A.at(i) - C.at(j)) + abs(B.at(i) - D.at(j));
        F.at(i) = j + 1;
      }
    }
    cout << F.at(i) << endl;
  }
}
