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