#include <bits/stdc++.h>
using namespace std;
int a[50], b[50], c[50], d[50];
signed main() {
  int n, m;
  scanf("%d%d", &n, &m);
  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 Min = INT_MAX, id;
    for (int j = 0; j < (n); j++) {
      if (Min > abs(a[i] - c[j]) + abs(b[i] - d[j])) {
        Min = abs(a[i] - c[j]) + abs(b[i] - d[j]);
        id = j;
      }
    }
    printf("%d\n", id + 1);
  }
}
