#include <bits/stdc++.h>
int a[55][2], b[55][2];
int main() {
  int n, m, mn, k;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%d%d", &a[i][0], &a[i][1]);
  for (int i = 1; i <= m; i++) scanf("%d%d", &b[i][0], &b[i][1]);
  for (int i = 1; i <= n; i++) {
    mn = 0x7fffffff;
    k = 1;
    for (int j = 1; j <= n; j++) {
      int t = abs(a[i][0] - b[j][0]) + abs(a[i][1] - b[j][1]);
      if (mn > t) {
        mn = t;
        k = j;
      }
    }
    printf("%d\n", k);
  }
  return 0;
}
