#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n = 0, m = 0;
  long int a[51], b[51], c[51], d[51];
  int ans[51];
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) {
    scanf("%ld%ld", &a[i], &b[i]);
  }
  for (int i = 0; i < m; i++) {
    scanf("%ld%ld", &c[i], &d[i]);
  }
  for (int i = 0; i < n; i++) {
    long int min = 200000000;
    long int len = 0;
    for (int j = 0; j < m; j++) {
      len = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (len < min) {
        min = len;
        ans[i] = j + 1;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    printf("%d\n", ans[i]);
  }
  return 0;
}
