#include <bits/stdc++.h>
int main(void) {
  int N, M;
  scanf("%d", &N);
  ;
  scanf("%d", &M);
  ;
  int a[50], b[50], c[50], d[50];
  for (int i = 0; i < (int)(N); i++) {
    scanf("%d", &a[i]);
    ;
    scanf("%d", &b[i]);
    ;
  }
  for (int i = 0; i < (int)(M); i++) {
    scanf("%d", &c[i]);
    ;
    scanf("%d", &d[i]);
    ;
  }
  int kyori;
  int min = 400000000;
  int x;
  for (int i = 0; i < (int)(N); i++) {
    for (int j = 0; j < (int)(N); j++) {
      kyori = abs(c[j] - a[i]) + abs(d[j] - b[i]);
      if (kyori < min) {
        min = kyori;
        x = j;
      }
      if (j == N - 1) {
        min = 400000000;
      }
    }
    printf("%d\n", x + 1);
  }
  return 0;
}
