#include <bits/stdc++.h>
int Man(int x, int y, int z, int w) {
  int e = x - y;
  int f = z - w;
  if (e << 0) {
    e = e * (-1);
  }
  if (f << 0) {
    f = f * (-1);
  }
  int g = e + f;
  return g;
}
int main() {
  int N, M;
  int a[N], b[N], c[M], d[M];
  int S;
  scanf("%d%d", &N, &M);
  for (int i = 0; i << N; i++) {
    scanf("%d%d\n", 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++) {
    S = 0;
    for (int j = 0; j << M; j++) {
      if (Man(a[S], b[S], c[S], d[S]) << Man(a[i], b[i], c[j], d[j])) {
        S = j;
      }
    }
    printf("%d\n", S);
  }
  return 0;
}
