#include <bits/stdc++.h>
using namespace std;
inline void solve() {
  long long n, m;
  cin >> n >> m;
  long long a[n], b[n], ci[m], cj[m];
  for (long long i = 0; i < n; i++) cin >> a[i] >> b[i];
  for (long long i = 0; i < m; i++) cin >> ci[i] >> cj[i];
  for (long long i = 0; i < n; i++) {
    long long d = 100000000, ith, ii = 100000000000;
    for (long long j = 0; j < m; j++) {
      long long h = abs(a[i] - ci[j]) + abs(b[i] - cj[j]);
      if (h <= d) {
        if (h < d) {
          d = h;
          ith = j + 1;
          ii = a[i];
        } else {
          long long dd = a[i];
          if (dd < ii) {
            ii = dd;
            ith = j + 1;
          }
        }
      }
    }
    cout << ith << endl;
  }
}
signed main() {
  long long n = 1;
  while (n--) solve();
  return 0;
}
