#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ll n, m;
  cin >> n >> m;
  vector<ll> a(n), b(n), c(m), d(m);
  for (int i = 0; i < n; i++) cin >> a[i] >> b[i];
  for (int j = 0; j < m; j++) cin >> c[j] >> d[j];
  for (int i = 0; i < n; i++) {
    ll mini = 1000;
    ll place;
    for (int j = 0; j < m; j++) {
      ll x = pow(pow(c[j] - a[i], 2), 0.5) + pow(pow(d[j] - b[i], 2), 0.5);
      if (x < mini) {
        mini = min(mini, x);
        place = j + 1;
      }
    }
    cout << place << endl;
  }
}
