#include <bits/stdc++.h>
int main(void) {
  int m, n;
  int i, j;
  scanf("%d %d", &n, &m);
  int a[n], b[n], c[m], d[m];
  for (i = 0; i < n; i++) {
    scanf("%d %d", &a[i], &b[i]);
  }
  for (j = 0; j < m; j++) {
    scanf("%d %d", &c[j], &d[j]);
  }
  int minp[n];
  unsigned long long min;
  int k, l, h;
  for (k = 0; k < n; k++) {
    min = sqrt((a[k] - c[0]) * (a[k] - c[0])) +
          sqrt((b[k] - d[0]) * (b[k] - d[0]));
    minp[k] = 1;
    for (l = 1; l < m; l++) {
      unsigned long long dis = sqrt((a[k] - c[l]) * (a[k] - c[l])) +
                               sqrt((b[k] - d[l]) * (b[k] - d[l]));
      if (dis < min) {
        min = dis;
        minp[k] = l + 1;
      }
    }
  }
  for (h = 0; h < n; h++) {
    printf("%d\n", minp[h]);
  }
  return 0;
}
