#include <bits/stdc++.h>
using namespace std;
const long long mei = (long long)1e9 + 7;
int main() {
  long long n, m, s, t, h;
  cin >> n >> m;
  vector<long long> a(n);
  vector<long long> b(n);
  vector<long long> c(m);
  vector<long long> d(m);
  for (long long i = 0; i < (long long)(n); i++) cin >> a[i] >> b[i];
  for (long long i = 0; i < (long long)(m); i++) cin >> c[i] >> d[i];
  for (long long i = 0; i < (long long)(n); i++) {
    s = 99999999999;
    h = 99999999999;
    for (long long j = 0; j < (long long)(m); j++) {
      t = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (s > t) {
        s = t;
        h = j;
      }
    }
    cout << h;
    cout << endl;
  }
}
