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