#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(n);
  vector<int> b(n);
  vector<int> c(m);
  vector<int> d(m);
  for (int i = (int)0; i < (int)n; ++i) cin >> a[i] >> b[i];
  for (int i = (int)0; i < (int)m; ++i) cin >> c[i] >> d[i];
  vector<int> ans(n);
  for (int i = (int)0; i < (int)n; ++i) {
    int minv = 1e9;
    for (int j = m - 1; j >= 0; j--) {
      int diff = abs(c[j] - a[i]) + abs(d[j] - b[i]);
      if (diff <= minv) {
        minv = diff;
        ans[i] = m + 1;
      }
    }
  }
  for (int i = (int)0; i < (int)n; ++i) cout << ans[i] << endl;
  return 0;
}
