#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, m;
  cin >> n >> m;
  vector<int> a(n);
  vector<int> b(n);
  vector<int> c(m);
  vector<int> d(m);
  for (int i = 0; i < n; i++) cin >> a.at(i) >> b.at(i);
  for (int i = 0; i < m; i++) cin >> c.at(i) >> d.at(i);
  int min = 100000000, num;
  for (int i = 0; i < n; i++) {
    num = -1;
    min = 100000000;
    for (int j = 0; j < m; j++) {
      long dis = abs(a.at(i) - c.at(j)) + abs(b.at(i) - d.at(j));
      if (dis < min) {
        min = dis;
        num = j + 1;
      }
    }
    cout << num << endl;
  }
  return 0;
}
