#include <bits/stdc++.h>
using namespace std;
long long a[55];
long long b[55];
long long c[55];
long long d[55];
long long abso(long long x) {
  if (x < 0)
    return -1 * x;
  else
    return x;
}
long long dist(long long a, long long b, long long c, long long d) {
  return (abso(a - c) + abso(b - d));
}
int main() {
  long long n, m, di, g = 1, h;
  scanf("%lld %lld", &n, &m);
  for (long long i = 1; i <= n; i++) {
    scanf("%lld %lld", &a[i], &b[i]);
  }
  for (long long i = 1; i <= m; i++) {
    scanf("%lld %lld", &c[i], &d[i]);
  }
  for (long long j = 1; j <= n; j++) {
    di = dist(a[j], b[j], c[1], d[1]);
    g = 1;
    for (long long i = 1; i <= m; i++) {
      if (dist(a[j], b[j], c[i], d[i]) < di) {
        di = dist(a[j], b[j], c[i], d[i]);
        g = i;
      }
    }
    printf("%lld\n", g);
  }
  return 0;
}
