#include <bits/stdc++.h>
using namespace std;
typedef struct {
  int length;
  int number;
} Pos;
int main() {
  int N, M, i, j, r;
  cin >> N >> M;
  int* sx = new int[N];
  int* sy = new int[N];
  int* cx = new int[M];
  int* cy = new int[M];
  Pos* min = new Pos[N];
  for (i = 0; i < N; i++) {
    cin >> sx[i] >> sy[i];
  }
  for (i = 0; i < M; i++) {
    cin >> cx[i] >> cy[i];
  }
  for (i = 0; i < N; i++) {
    min[i].length = INT_MAX;
    min[i].number = 0;
  }
  for (i = 0; i < N; i++) {
    for (j = 0; j < N; j++) {
      r = abs(sx[i] - cx[j]) + abs(sy[i] - cy[j]);
      if (r < min[i].length) {
        min[i].length = r;
        min[i].number = i + 1;
      }
    }
    printf("%d\n", min[i].number);
  }
  return 0;
}
