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