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