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