#include <bits/stdc++.h>
long long a[50 + 1], b[50 + 1], c[50 + 1], d[50 + 1];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%lld%lld", &a[i], &b[i]);
  }
  for (int i = 1; i <= m; i++) {
    scanf("%lld%lld", &c[i], &d[i]);
  }
  for (int i = 1; i <= n; i++) {
    long long min = 100000000 + 2;
    long long rez = -1;
    for (int j = 1; j <= m; j++) {
      long long l = std::abs(a[i] - c[j]) + std::abs(b[i] - d[j]);
      if (min > l) {
        min = l;
        rez = j;
      }
    }
    printf("%lld", rez);
    printf("%c", '\n');
  }
  return 0;
}
