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