#include <bits/stdc++.h>
using namespace std;
int main(int argc, char* argv[]) {
  long long N, M;
  long long min, cnt;
  cin >> N >> M;
  vector<long long> a(N), b(N);
  vector<long long> c(N), 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++) {
    min = 10e8;
    cnt = 0;
    for (int j = 0; j < M; j++) {
      if (min > labs((long long)a[i] - c[j]) + labs((long long)b[i] - d[j])) {
        min = labs((long long)a[i] - c[j]) + labs((long long)b[i] - d[j]);
        cnt = j + 1;
      }
    }
    cout << cnt << endl;
  }
  return 0;
}
