#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  vector<pair<int, int>> P(N);
  vector<int> ans(N);
  vector<pair<int, int>> C(M);
  for (int i = 0; i < N; i++) cin >> P[i].first >> P[i].second;
  for (int i = 0; i < M; i++) cin >> C[i].first >> C[i].second;
  for (int i = 0; i < N; i++) {
    long long tmp = 2 * 1e8;
    for (int j = M - 1; j >= 0; j--) {
      if (tmp >=
          abs(P[i].first - C[j].first) + abs(P[i].second - C[j].second)) {
        tmp = abs(P[i].first - C[j].first) + abs(P[i].second - C[j].second);
        ans[i] = j + 1;
      }
    }
  }
  for (int i = 0; i < N; i++) cout << ans[i] << endl;
  return 0;
}
