#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<pair<int, int>> s(n);
  vector<pair<int, int>> g(m);
  for (int i = 0; i < n; i++) {
    cin >> s.at(i).first >> s.at(i).second;
  }
  for (int i = 0; i < m; i++) {
    cin >> g.at(i).first >> g.at(i).second;
  }
  for (int i = 0; i < n; i++) {
    int nearest;
    int distance = 100000000;
    for (int j = 0; j < m; j++) {
      int x = abs(g.at(j).first - s.at(i).first) +
              abs(g.at(j).second - s.at(i).second);
      if (x < distance) {
        nearest = j;
        distance = x;
      }
    }
    cout << nearest << endl;
  }
  return 0;
}
