#include <bits/stdc++.h>
typedef struct {
  int x;
  int y;
} point;
int MHD(point p1, point p2) { return abs(p1.x - p2.x) + abs(p1.y - p2.y); }
int main(int argc, char const *argv[]) {
  int n, m;
  int min, pNum;
  point std[53], cp[53];
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; ++i) scanf("%d%d", &std[i].x, &std[i].y);
  for (int i = 0; i < m; ++i) scanf("%d%d", &cp[i].x, &cp[i].y);
  for (int i = 0; i < n; ++i) {
    min = 0x07FFFFFF;
    pNum = 0;
    for (int j = 0; j < m; ++j) {
      if (MHD(std[i], cp[j]) < min) {
        min = MHD(std[i], cp[j]);
        pNum = j;
      }
    }
    printf("%d\n", pNum + 1);
  }
  return 0;
}
