#include <bits/stdc++.h>
using namespace std;
int a[100], b[100], c[100], d[100];
int md(int x1, int y1, int x2, int y2) { return abs(x1 - x2) + abs(y1 - y2); }
int main() {
  int N, M;
  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 curmin = 100000;
    int curnode = 0;
    for (int j = M; j >= 1; j--) {
      if (md(a[i], b[i], c[j], d[j]) < curmin) {
        curnode = j;
        curmin = md(a[i], b[i], c[j], d[j]);
      }
    }
    printf("%d\n", curnode);
  }
}
