#include <bits/stdc++.h>
using namespace std;
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long n, m;
  cin >> n >> m;
  vector<pair<long long, long long> > s(n);
  vector<pair<long long, long long> > c(m);
  for (long long i = (0); i < (n); i++) cin >> s[i].first >> s[i].second;
  for (long long i = (0); i < (m); i++) cin >> c[i].first >> c[i].second;
  for (long long i = (0); i < (n); i++) {
    long long mini = 1e9 + 7, ans = m;
    for (long long j = m - 1; j >= 0; j--) {
      long long dis =
          abs(c[i].first - s[j].first) + abs(s[i].second - c[j].second);
      if (dis <= mini) {
        mini = dis;
        ans = j + 1;
      }
    }
    cout << ans << "\n";
  }
}
