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