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