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