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