#include <bits/stdc++.h>
using namespace std;
int main() {
  {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
  };
  int y, x, j, i, n, m;
  cin >> n >> m;
  vector<pair<int, int> > v, v2;
  for (i = 0; i < n; i++) {
    cin >> x >> y;
    v.push_back({x, y});
  }
  for (j = 0; j < n; j++) {
    cin >> x >> y;
    v2.push_back({x, y});
  }
  for (i = 0; i < n; i++) {
    int mi = INT_MAX, ans = 0;
    for (j = 0; j < m; j++) {
      if (min(mi, abs(v[i].first - v2[j].first) +
                      abs(v[i].second - v2[j].second)) < mi) {
        ans = j + 1;
        mi = min(mi, abs(v[i].first - v2[j].first) +
                         abs(v[i].second - v2[j].second));
      }
    }
    cout << ans << "\n";
  }
  return 0;
}
