#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, m;
  cin >> n >> m;
  long a[n], b[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> b[i];
  }
  long c[m], d[m];
  for (int i = 0; i < m; i++) {
    cin >> c[i] >> d[i];
  }
  for (int i = 0; i < n; i++) {
    long tmp = 101001000 * 2;
    int id = -1;
    for (int j = m - 1; j >= 0; j--) {
      if (tmp >= abs(a[i] - c[j]) + abs(b[i] - d[j])) {
        id = j;
        tmp = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      }
    }
    cout << id + 1 << endl;
  }
}
