#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> a(N), b(N), c(M), 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);
  }
  vector<int> point(N);
  for (int i = 0; i < N; i++) {
    int min = abs(a.at(i) - c.at(0)) + abs(b.at(i) - d.at(0));
    for (int j = 0; j < M; j++) {
      int dx = abs(a.at(i) - c.at(j)) + abs(b.at(i) - d.at(j));
      if (min > dx) {
        min = dx;
        point.at(i) = j + 1;
      }
    }
  }
  for (int i = 0; i < N; i++) {
    cout << point.at(i) << endl;
  }
}
