#include <bits/stdc++.h>
int main(void) {
  int i, k, temp, N, M;
  scanf("%d %d", &N, &M);
  int n[N][2];
  int m[M][2];
  int answer[N][2];
  for (i = 0; i < N; i++) {
    scanf("%d %d", &n[i][0], &n[i][1]);
  }
  for (i = 0; i < M; i++) {
    scanf("%d %d", &m[i][0], &m[i][1]);
  }
  for (i = 0; i < N; i++) {
    answer[i][1] = 100000000;
  }
  for (i = 0; i < N; i++) {
    for (k = 0; k < M; k++) {
      if (n[i][0] > m[k][0]) {
        temp = n[i][0] - m[k][0];
      } else {
        temp = m[k][0] - n[i][0];
      }
      if (n[i][1] > m[k][1]) {
        temp += n[i][1] - m[k][1];
      } else {
        temp += m[k][1] - n[i][1];
      }
      if (answer[i][1] > temp) {
        answer[i][0] = k + 1;
        answer[i][1] = temp;
      }
    }
  }
  for (i = 0; i < N; i++) {
    printf("%d\n", answer[i][0]);
  }
}
