#include <bits/stdc++.h>
using namespace std;
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);
  }
  int A = 1000000000, B, C;
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < M; j++) {
      B = abs(a.at(i) - c.at(i) + b.at(j) - d.at(j));
      if (A > B) {
        C = j;
      }
      A = min(A, B);
    }
    cout << C + 1 << endl;
    A = 1000000000;
  }
}
