#include <bits/stdc++.h>
using namespace std;
const int maxn = 55;
int n, m, a[maxn], b[maxn], c[maxn], d[maxn];
inline int myabs(int a) { return a > 0 ? a : -a; }
inline int mht(int A, int B, int C, int D) {
  return myabs(A - C) + myabs(B - D);
}
int main() {
  scanf("%d%d", &n, &m);
  for (register int i = 1; i <= n; i++) scanf("%d%d", &a[i], &b[i]);
  for (register int i = 1; i <= m; i++) scanf("%d%d", &c[i], &d[i]);
  int minn, minx, temp;
  for (register int i = 1; i <= n; i++) {
    minx = 2e8;
    for (register int j = 1; j <= m; j++) {
      temp = mht(a[i], b[i], c[j], d[j]);
      if (temp < minx) {
        minx = temp;
        minn = j;
      }
    }
    printf("%d\n", minn);
  }
  return 0;
}
