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