#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> xa(n), ya(n);
  for (int i = 0; i < n; i++) cin >> xa[i] >> ya[i];
  vector<int> xb(m), yb(m);
  for (int i = 0; i < m; i++) cin >> xb[i] >> yb[i];
  for (int i = 0; i < n; i++) {
    int min = 50000000;
    int min_n = 0;
    for (int j = 0; j < m; j++) {
      int tmp = abs(xa[i] - xb[j]) + abs(ya[i] - yb[j]);
      if (tmp < min) {
        min = tmp;
        min_n = j + 1;
      }
    }
    cout << min_n << endl;
  }
}
