#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long long int N, M, mi, distan, poi;
  poi = 51;
  mi = 100000000;
  cin >> N >> M;
  vector<long long 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];
  map<long long int, long long int> mp;
  for (long long int i = 0; i < N; i++) {
    for (long long int j = 0; j < M; j++) {
      distan = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      mi = min(mi, distan);
      if (mp[mi] == 0) mp[mi] = j + 1;
    }
    cout << mp[mi] << endl;
    mp.clear();
    mi = 100000000;
  }
}
