#include <bits/stdc++.h>
typedef struct {
  int x, y;
} point;
int min(int a, int b) {
  if (a < b)
    return a;
  else
    return b;
}
int main(void) {
  point s[50];
  point c[50];
  int n, m, i, minimum, j, t, ans;
  scanf("%d %d", &n, &m);
  for (i = 0; i < n; i++) {
    scanf("%d %d", &s[i].x, &s[i].y);
  }
  for (j = 0; j < m; j++) {
    scanf("%d %d", &c[j].x, &c[j].y);
  }
  for (i = 0; i < n; i++) {
    minimum = 1000000;
    for (j = 0; j < m; j++) {
      t = abs(s[i].x - c[j].x) + abs(s[i].y - c[j].y);
      if (minimum > t) {
        ans = j;
        minimum = t;
      }
    }
    printf("%d\n", ans + 1);
  }
  return 0;
}
