#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M, min_i, min_j, check;
  cin >> N >> M;
  vector<int> a(N);
  vector<int> b(N);
  vector<int> c(M);
  vector<int> d(M);
  for (int i = 0; i < N; i++) cin >> a.at(i) >> b.at(i);
  for (int i = 0; i < M; i++) cin >> c.at(i) >> d.at(i);
  for (int i = 0; i < N; i++) {
    min_i = abs(a.at(i) - c.at(0)) + abs(b.at(i) - d.at(i));
    check = 1;
    for (int j = 0; j < M; j++) {
      min_j = abs(a.at(i) - c.at(j)) + abs(b.at(i) - d.at(j));
      if (min_i > min_j) {
        min_i = min_j;
        check = 1 + j;
      }
    }
    cout << check << endl;
  }
}
