#include <bits/stdc++.h>
using namespace std;
signed main() {
  int N, M;
  long a[51];
  long b[51];
  long c[51];
  long d[51];
  scanf("%d %d", &N, &M);
  for (int i = 0; i < N; i++) {
    scanf("%ld %ld", &a[i], &b[i]);
  }
  for (int i = 0; i < M; i++) {
    scanf("%ld %ld", &c[i], &d[i]);
  }
  for (int j = 0; j < N; j++) {
    long min = 1 << 23;
    int idx_m = -1;
    for (int i = 0; i < M; i++) {
      if (abs(c[i] - a[j]) + abs(d[i] - b[j]) < min) {
        min = abs(c[i] - a[j]) + abs(d[i] - b[j]);
        idx_m = i;
      }
    }
    printf("%d\n", idx_m + 1);
  }
}
