#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(n), b(n), c(m), 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);
  for (int i = 0; i < m; i++) {
    int tmp = 0;
    for (int j = 0; j < n; j++) {
      if (abs(a.at(i) - c.at(j)) + abs(b.at(i) - d.at(j)) <
          abs(a.at(i) - c.at(tmp)) + abs(b.at(i) - d.at(tmp)))
        tmp = j;
    }
    cout << tmp + 1 << endl;
  }
}
