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