#include <bits/stdc++.h>
int main() {
  int n, m;
  int a[56], b[56], c[56], d[56];
  int i, j, s;
  long long min;
  scanf("%d %d", &n, &m);
  for (i = 1; i <= n; i++) scanf("%d %d", &a[i], &b[i]);
  for (i = 1; i <= m; i++) scanf("%d %d", &c[i], &d[i]);
  for (i = 1; i <= n; i++) {
    min = 100100100;
    for (j = 1; j <= m; j++) {
      if ((abs(a[i] - c[j]) + abs(b[i] - d[j])) < min) {
        s = j;
        min = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      }
    }
    printf("%d\n", s);
  }
  return 0;
}
