#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  int NMAX = 50;
  vector<int> A(NMAX), B(NMAX), C(NMAX), D(NMAX);
  for (int i = 0; i < N; i++) {
    cin >> A.at(i) >> B.at(i);
  }
  for (int j = 0; j < M; j++) {
    cin >> C.at(j) >> D.at(j);
  }
  int dist, ans;
  for (int i = 0; i < N; i++) {
    int k = 100000000;
    for (int j = 0; j < M; j++) {
      dist = abs(A.at(i) - C.at(j)) + abs(B.at(i) - D.at(j));
      if (k > dist) {
        k = dist;
        ans = j + 1;
      }
    }
    cout << ans << endl;
  }
}
