#include <bits/stdc++.h>
using namespace std;
int n, m, a[60], b[60], c[60], d[60];
signed main() {
  scanf("%d%d", &n, &m);
  for (register int(i)(0); (i) ^ (n); (i)++) {
    scanf("%d%d", &a[i], &b[i]);
  }
  for (register int(i)(0); (i) ^ (m); (i)++) {
    scanf("%d%d", &c[i], &d[i]);
  }
  for (register int(i)(0); (i) ^ (n); (i)++) {
    int ans(0), cnt(0x7f);
    for (register int(j)(0); (j) ^ (m); (j)++) {
      int t(((abs(a[i] - c[j])) + (abs(b[i] - d[j]))));
      if (t < cnt) {
        cnt = t, ans = j;
      }
    }
    printf("%d", (ans + 1)), putchar(10);
  }
  return 0;
}
