#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  vector<long long int> a(N);
  vector<long long int> b(N);
  vector<long long int> c(M);
  vector<long long int> d(M);
  vector<int> ans(N);
  for (int i = 0; i < N; i++) {
    cin >> a.at(i) >> b.at(i);
  }
  for (int i = 0; i < M; i++) {
    cin >> c.at(i) >> d.at(i);
  }
  for (int i = 0; i < N; i++) {
    long long int mintmp = 200000000;
    int minind = -1;
    for (int j = 0; j < M; j++) {
      long long int dist = abs(a.at(i) - c.at(j)) + abs(b.at(i) - d.at(j));
      if (mintmp > dist) {
        mintmp = dist;
        minind = j + 1;
      }
    }
    ans.at(i) = minind;
  }
  for (int i = 0; i < N; i++) {
    cout << ans.at(i) << endl;
  }
}
