#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll GetDigit(ll num) { return log10(num) + 1; }
int main() {
  int n, m;
  cin >> n >> m;
  vector<pair<ll, ll>> a(n);
  vector<pair<ll, ll>> b(m);
  for (int i = 0; i < (int)(n); i++) {
    cin >> a[i].first >> a[i].second;
  }
  for (int i = 0; i < (int)(m); i++) {
    cin >> b[i].first >> b[i].second;
  }
  vector<ll> dist(n, 100000001);
  vector<ll> ans(n);
  for (int i = 0; i < (int)(n); i++) {
    for (int j = 0; j < (int)(m); j++) {
      if (abs(a[i].first - b[j].first) + abs(a[i].second - b[j].second) <
          dist[i]) {
        dist[i] = abs(a[i].first - b[j].first) + abs(a[i].second - b[j].second);
        ans[i] = j + 1;
      }
    }
  }
  for (int i = 0; i < (int)(n); i++) {
    cout << ans[i] << endl;
  }
  return 0;
}
