#include <bits/stdc++.h>
using ll = long long;
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  vector<pair<int, int>> ab(N);
  for (int i = 0; i < (int)N; i++) {
    int a, b;
    cin >> a >> b;
    ab[i] = make_pair(a, b);
  }
  vector<pair<int, int>> cd(M);
  for (int i = 0; i < (int)M; i++) {
    int c, d;
    cin >> c >> d;
    cd[i] = make_pair(c, d);
  }
  vector<bool> seen(M);
  for (int i = 0; i < (int)N; i++) {
    int min_v = 1e9;
    int min_i = -1;
    for (int j = 0; j < (int)M; j++) {
      if (seen[j]) continue;
      if (min_v >
          abs(ab[i].first - cd[j].first) + abs(ab[i].second - cd[j].second)) {
        min_v =
            abs(ab[i].first - cd[j].first) + abs(ab[i].second - cd[j].second);
        min_i = j;
      }
    }
    cout << min_i + 1 << endl;
    seen[min_i] = true;
  }
  return 0;
}
