#include <bits/stdc++.h>
int main() {
  int a1[60], b1[69], a2[59], b2[59], ain, n, m;
  while (~scanf("%d %d", &n, &m)) {
    for (int i = 1; i <= n; i++) scanf("%d %d", &a1[i], &b1[i]);
    for (int i = 1; i <= m; i++) scanf("%d %d", &a2[i], &b2[i]);
    for (int i = 1; i <= n; i++) {
      int max = 1000000000;
      for (int j = m; j >= 1; j--) {
        if (abs(a1[i] - a2[j]) + abs(b1[i] - b2[j]) <= max) {
          max = abs(a1[i] - a2[j]) + abs(b1[i] - b2[j]);
          ain = j;
        }
      }
      printf("%d\n", ain);
    }
  }
}
