#include <bits/stdc++.h>
int asc_cmp(const void* X, const void* Y) {
  int x = *(int*)X, y = *(int*)Y;
  if (x < y)
    return -1;
  else if (x == y)
    return 0;
  else
    return 1;
}
int desc_cmp(const void* X, const void* Y) {
  int x = *(int*)X, y = *(int*)Y;
  if (x < y)
    return 1;
  else if (x == y)
    return 0;
  else
    return -1;
}
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  int a[n], b[n];
  for (int i = 0; i < n; i++) scanf("%d %d", &a[i], &b[i]);
  int c[m], d[m];
  for (int i = 0; i < m; i++) scanf("%d %d", &c[i], &d[i]);
  int dest, min, index;
  for (int i = 0; i < n; i++) {
    min = 99999999;
    for (int j = 0; j < m; j++) {
      dest = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (min > dest) {
        min = dest;
        index = j + 1;
      }
    }
    printf("%d\n", index);
  }
}
