#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M, ans;
  cin >> N >> M;
  long a[N], b[N], c[M], d[M], r;
  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++) {
    ans = 1;
    r = (a[i] - c[0]) + abs(b[i] - d[0]);
    for (int j = 1; j < M; j++) {
      ans = abs(a[i] - c[j]) + abs(b[i] - d[j]) < r ? j + 1 : ans;
      r = min(r, abs(a[i] - c[j]) + abs(b[i] - d[j]));
    }
    cout << ans << endl;
  }
  return 0;
}
