#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  vector<pair<int, int>> s(N);
  for (int i = 0; i < N; i++) {
    cin >> s.at(i).first;
    cin >> s.at(i).second;
  }
  vector<pair<int, int>> c(M);
  for (int i = 0; i < M; i++) {
    cin >> c.at(i).first;
    cin >> c.at(i).second;
  }
  for (int i = 0; i < N; i++) {
    int min_length = abs(s.at(i).first - c.at(0).first) +
                     abs(s.at(i).second - c.at(0).second);
    int checkpoint = 1;
    for (int j = 0; j < M; j++) {
      const int length = abs(s.at(i).first - c.at(j).first) +
                         abs(s.at(i).second - c.at(j).second);
      if (min_length >= length) {
        min_length = length;
        checkpoint = j + 1;
      }
    }
    cout << checkpoint << endl;
  }
  return 0;
}
