#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++) {
    int a, b;
    cin >> a >> b;
    p[i] = make_pair(a, b);
  }
  for (int i = 0; i < N; i++) {
    int c, d;
    cin >> c >> d;
    ch[i] = make_pair(c, d);
  }
  for (int i = 0; i < N; i++) {
    vector<pair<int, int>> D(M);
    for (int j = 0; j < M; j++) {
      int dist =
          abs(p[i].first - ch[j].first) + abs(p[i].second - ch[j].second);
      D[j] = make_pair(dist, j + 1);
    }
    sort(D.begin(), D.end());
    cout << D[0].second << endl;
  }
}
