#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) {
    int a, b;
    cin >> a >> b;
    students[i] = make_pair(a, b);
  }
  vector<pair<int, int> > ans(N, pair<int, int>(0, INT_MAX));
  for (int i = 0; i < M; ++i) {
    int c, d;
    cin >> c >> d;
    for (int j = 0; j < N; ++j) {
      int distance = abs(students[j].first - c) + abs(students[j].second - d);
      if (ans[j].second > distance) {
        ans[j].first = i;
        ans[j].second = distance;
      }
    }
  }
  for (int i = 0; i < N; ++i) {
    cout << ans[i].first + 1 << endl;
  }
  return 0;
}
