#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  long long a[51], b[51], c[51], d[51];
  for (long long i = 1; i < N + 1; i++) {
    cin >> a[i] >> b[i];
  }
  for (long long i = 1; i < M + 1; i++) {
    cin >> c[i] >> d[i];
  }
  int minID;
  for (long long i = 1; i < N + 1; i++) {
    long long minCheck = 1 << 21;
    for (int j = M; j > 0; j--) {
      long long A = (a[i] - c[j]);
      A = (A < 0) ? -A : A;
      long long B = (b[i] - d[j]);
      B = (B < 0) ? -B : B;
      if (minCheck >= A + B) {
        minCheck = A + B;
        minID = j;
      }
    }
    cout << minID << endl;
  }
  return 0;
}
