#include <bits/stdc++.h>
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  int student[50][2];
  int chkpt[50][2];
  for (int i = 0; i < n; i++) {
    int ai, bi;
    scanf("%d %d", &ai, &bi);
    student[i][0] = ai;
    student[i][1] = ai;
  }
  for (int j = 0; j < m; j++) {
    int cj, dj;
    scanf("%d %d", &cj, &dj);
    chkpt[j][0] = cj;
    chkpt[j][1] = dj;
  }
  for (int i = 0; i < n; i++) {
    int min =
        abs(student[i][0] - chkpt[0][0]) + abs(student[i][1] - chkpt[0][1]);
    int num = 0;
    for (int j = 1; j < m; j++) {
      int _min =
          abs(student[i][0] - chkpt[j][0]) + abs(student[i][1] - chkpt[j][1]);
      if (_min < min) {
        min = _min;
        num = j;
      }
    }
    printf("%d\n", num + 1);
  }
}
