#include <bits/stdc++.h>
using namespace std;
int main(int argc, char *argv[]) {
  int N, M, a[60], b[60], c[60], d[60];
  cin >> N >> M;
  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++) {
    long long v = 1e18;
    int ans = 0;
    for (int j = 0; j < M; j++) {
      long long tmp = abs(c[j] - a[i]) + abs(b[j] - d[i]);
      if (v > tmp) {
        ans = j + 1;
        v = tmp;
      }
    }
    printf("%d\n", ans);
  }
  return 0;
}
