#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  long a[50], b[50], c[50], d[50];
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; i++) {
    scanf("%ld %ld", &a[i], &b[i]);
  }
  for (int i = 0; i < m; i++) {
    scanf("%ld %ld", &c[i], &d[i]);
  }
  for (int i = 0; i < n; i++) {
    int point = 0;
    long cnt = 100000000;
    for (int j = 0; j < m; j++) {
      if (cnt > abs(c[j] - a[i]) + abs(d[j] - b[i])) {
        point = j + 1;
        cnt = abs(c[j] - a[i]) + abs(d[j] - b[i]);
      }
    }
    printf("%d\n", point);
  }
  return 0;
}
