#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  vector<pair<int, int>> students(N);
  for (int i = 0; i < N; i++) {
    cin >> students.at(i).first;
    cin >> students.at(i).second;
  }
  vector<pair<int, int>> checkpoints(M);
  for (int i = 0; i < M; i++) {
    cin >> checkpoints.at(i).first;
    cin >> checkpoints.at(i).second;
  }
  reverse(checkpoints.begin(), checkpoints.end());
  vector<int> checkpoint_number(N);
  for (int i = 0; i < N; i++) {
    int min_length = 100000000;
    for (int j = 0; j < M; j++) {
      int length = abs(students.at(i).first - checkpoints.at(j).first) +
                   abs(students.at(i).second - checkpoints.at(j).second);
      if (min_length >= length) {
        checkpoint_number.at(i) = N - j;
        min_length = length;
      }
    }
  }
  for (int i = 0; i < N; i++) {
    cout << checkpoint_number.at(i) << endl;
  }
}
