#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, m, c, d, checkp;
  cin >> n >> m;
  int a[n], b[n];
  for (int i = 0; i < n; i++) scanf("%d %d", &a[i], &b[i]);
  for (int j = 0; j < n; j++) {
    int min_l = 100000;
    for (int i = 0; i < m; i++) {
      scanf("%d %d", &c, &d);
      int l = abs(a[j] - c) + abs(b[j] - d);
      if (l < min_l) {
        min_l = l;
        checkp = i;
      }
    }
    cout << checkp + 1 << endl;
  }
}
