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