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