#include <bits/stdc++.h>
using namespace std;
const int INF = 1e8 + 1;
int main(void) {
  int N, M;
  cin >> N >> M;
  vector<pair<int, int> > a(N), c(M);
  for (int i = 0; i < N; i++) {
    cin >> a[i].first >> a[i].second;
  }
  for (int i = 0; i < M; i++) {
    cin >> c[i].first >> c[i].second;
  }
  vector<int> ans(N);
  for (int i = 0; i < N; i++) {
    int closest_idx = -1;
    int closest_dst = INF;
    for (int j = 0; j < M; j++) {
      int dest = abs(a[i].first - c[j].first) + abs(a[i].second - c[j].second);
      if (dest < closest_dst) {
        closest_idx = j;
        closest_dst = dest;
      }
    }
    ans[i] = closest_idx;
  }
  for (int i = 0; i < N; i++) {
    cout << ans[i] + 1 << endl;
  }
}
