#include <bits/stdc++.h>
const int inf = 1000000000;
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  int a[51], b[51], c[51], d[51];
  long int ans[51];
  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 _shortest = inf;
    for (int j = n - 1; j >= 0; j--) {
      if (_shortest > abs(a[i] - c[j]) + abs(b[i] - d[j])) {
        ans[i] = j + 1;
        _shortest = (abs(a[i] - c[j]) + abs(b[i] - d[j]));
      }
    }
  }
  for (int i = 0; i < n; i++) printf("%d\n", ans[i]);
}
