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