#include <bits/stdc++.h>
using namespace std;
int sa(int a, int b) {
  if (a > b)
    return a - b;
  else
    return b - a;
}
int main() {
  int N, M;
  cin >> N >> M;
  vector<pair<int, int>> A(N);
  vector<pair<int, int>> C(M);
  for (int i = 0; i < N; i++) {
    cin >> A.at(i).first >> A.at(i).second;
  }
  for (int i = 0; i < M; i++) {
    cin >> C.at(i).first >> C.at(i).second;
  }
  for (int i = 0; i < N; i++) {
    int d =
        sa(A.at(0).first, C.at(0).first) + sa(A.at(0).second, C.at(0).second);
    int k = 1;
    for (int j = 0; j < M; j++) {
      if (d > sa(A.at(i).first, C.at(i).first) +
                  sa(A.at(i).second, C.at(i).second)) {
        d = sa(A.at(i).first, C.at(i).first) +
            sa(A.at(i).second, C.at(i).second);
        k = j + 1;
      }
    }
    cout << k << endl;
  }
}
