#include <bits/stdc++.h>
using namespace std;
int dis(int a, int b) {
  int D = a - b;
  if (D > 0)
    return D;
  else
    return -D;
}
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> a(N);
  vector<int> b(N);
  for (int i = 0; i < N; i++) {
    cin >> a.at(i) >> b.at(i);
  }
  vector<int> c(M);
  vector<int> d(M);
  for (int i = 0; i < M; i++) {
    cin >> c.at(i) >> d.at(i);
  }
  vector<int> D(M);
  for (int i = 0; i < N; i++) {
    int number = 0;
    int min = 100;
    for (int j = 0; j < M; j++) {
      D.at(j) = dis(a.at(i), c.at(j)) + dis(b.at(i), d.at(j));
      if (min > D.at(j)) {
        min = D.at(j);
        number = j;
      }
    }
    cout << number + 1 << endl;
  }
}
