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