#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  vector<pair<int, int>> p(N);
  vector<pair<int, int>> ch(N);
  for (int i = 0; i < N; i++) {
    cin >> p[i].first >> p[i].second;
  }
  for (int i = 0; i < N; i++) {
    cin >> ch[i].first >> ch[i].second;
  }
  for (int i = 0; i < N; i++) {
    vector<pair<int, int>> D(M);
    for (int j = 0; j < M; j++) {
      D[j].first =
          abs(p[i].first - ch[j].first) + abs(p[i].second - ch[j].second);
      D[j].second = j + 1;
    }
    sort(D.begin(), D.end());
    cout << D[0].second << endl;
    D.clear();
  }
}
