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