#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int64_t> a(n), b(n), c(m), d(m);
  for (int i = 0; i < n; i++) cin >> a.at(i) >> b.at(i);
  for (int i = 0; i < m; i++) cin >> c.at(i) >> d.at(i);
  vector<int> ans(n);
  for (int i = 0; i < n; i++) {
    int tmp = 0;
    int64_t mm = 10000000000;
    for (int j = 0; j < m; j++) {
      int dis = abs(a.at(i) - c.at(j)) + abs(b.at(i) - d.at(j));
      if (mm > dis) {
        mm = dis;
        tmp = j;
      }
    }
    ans.at(i) = tmp;
  }
  for (int i = 0; i < n; i++) cout << ans.at(i) << endl;
  return 0;
}
