#include <bits/stdc++.h>
static const long long INF = 1000000000000000000LL;
using namespace std;
const int MOD = 1000000007;
int main() {
  int N, M;
  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 < (N); i++) {
    cin >> a[i] >> b[i];
  }
  for (long long i = 0; i < (M); i++) {
    cin >> c[i] >> d[i];
  }
  long long res = 0;
  for (long long i = 0; i < (N); i++) {
    long long imin = INF;
    for (long long j = 0; j < (M); j++) {
      long long tmp;
      tmp = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (tmp < imin) {
        res = i + 1;
        imin = tmp;
      }
    }
    cout << res << endl;
  }
  return 0;
}
