#include <bits/stdc++.h>
using namespace std;
static const int MOD = 1000000007;
int N, M;
int main() {
  cin >> N >> M;
  vector<int> a(N);
  vector<int> b(N);
  vector<int> c(M);
  vector<int> d(M);
  for (int i = (int)0; i < (int)N; ++i) {
    cin >> a[i] >> b[i];
  }
  for (int i = (int)0; i < (int)M; ++i) {
    cin >> c[i] >> d[i];
  }
  int num;
  int distance, tmp;
  for (int i = (int)0; i < (int)N; ++i) {
    distance = 2e8;
    for (int j = (int)0; j < (int)M; ++j) {
      tmp = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (tmp < distance) {
        distance = tmp;
        num = j + 1;
      }
    }
    cout << num << endl;
  }
  return 0;
}
