#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int N, M;
  cin >> N >> M;
  vector<pair<int, int> > stu(N);
  vector<pair<int, int> > check(M);
  for (int i = 0; i < N; i++) {
    int a, b;
    cin >> a >> b;
    stu[i] = pair<int, int>(a, b);
  }
  for (int i = 0; i < M; i++) {
    int c, d;
    cin >> c >> d;
    check[i] = pair<int, int>(c, d);
  }
  for (int i = 0; i < N; i++) {
    pair<int, int> ans = pair<int, int>(-1, 10000);
    for (int j = M; j >= 0; j--) {
      int man = abs(check[j].first - stu[i].first) +
                abs(check[j].second - stu[i].second);
      if (man < ans.second) {
        ans = pair<int, int>(j + 1, man);
      }
    }
    cout << ans.first << endl;
  }
  return 0;
}
