#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  int a, b;
  vector<vector<int> > ab(N);
  for (int i = 0; i < N; i++) {
    cin >> a >> b;
    ab[i] = {a, b};
  }
  vector<int> ans(N), d(N, 2 * (1 << 9));
  for (int i = 0; i < M; i++) {
    cin >> a >> b;
    for (int j = 0; j < N; j++) {
      int x = abs(ab[j][0] - a) + abs(ab[j][1] - b);
      if (x < d[j]) {
        ans[j] = i + 1;
        d[j] = x;
      }
    }
  }
  for (int i = 0; i < N; i++) {
    cout << ans[i] << endl;
  }
}
