#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<pair<int, int> > S(n), C(n);
  for (int i = 0; i < n; i++) cin >> S[i].first >> S[i].second;
  for (int i = 0; i < m; i++) cin >> C[i].first >> C[i].second;
  const int INF = 1000000000;
  vector<int> I(n);
  for (int i = 0; i < n; i++) {
    int min_ = INF;
    for (int j = 0; j < m; j++) {
      int d = abs(S[i].first - C[j].first) + abs(S[i].second - C[j].second);
      if (min_ > d) {
        I[i] = j + 1;
        min_ = d;
      }
    }
  }
  for (int i = 0; i < n; i++) cout << I[i] << endl;
  return 0;
}
