#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  vector<pair<int, int>> students;
  vector<pair<int, int>> checkpoint;
  int temp1, temp2;
  for (int i = 0; i < N; ++i) {
    cin >> temp1 >> temp2;
    students.emplace_back(make_pair(temp1, temp2));
  }
  for (int i = 0; i < M; ++i) {
    cin >> temp1 >> temp2;
    checkpoint.emplace_back(make_pair(temp1, temp2));
  }
  for (int i = 0; i < N; ++i) {
    int ans = 0, temp = (int)1e6;
    for (int j = M - 1; j >= 0; --j) {
      int length = abs(students[i].first - checkpoint[j].first) +
                   abs(students[i].second - checkpoint[j].second);
      temp = min(temp, length);
      if (temp == length) ans = j + 1;
    }
    cout << ans << endl;
  }
}
