#include <bits/stdc++.h>
double Mdis(int x1, int y1, int x2, int y2) {
  long long a = x2 - x1;
  long long b = y2 - y1;
  return sqrt(pow(a, 2) + pow(b, 2));
}
int main() {
  int N, M, a[60], b[60], c[60], d[60];
  scanf("%d %d", &N, &M);
  for (int i = 0; i < N; i++) {
    scanf("%d %d", &a[i], &b[i]);
  }
  for (int i = 0; i < M; i++) {
    scanf("%d %d", &c[i], &d[i]);
  }
  for (int i = 0; i < N; i++) {
    int pos;
    double dis = 1e9;
    for (int j = 0; j < M; j++) {
      if (Mdis(a[i], b[i], c[j], d[j]) < dis) {
        pos = j;
        dis = Mdis(a[i], b[i], c[j], d[j]);
      }
    }
    printf("%d\n", pos + 1);
  }
  return 0;
}
