#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, ans;
  cin >> n >> m;
  vector<long long> x(n), y(n), a(m), b(m);
  for (int i = 0; i < (n); i++) cin >> x[i] >> y[i];
  for (int j = 0; j < (m); j++) cin >> a[j] >> b[j];
  long long d, l;
  for (int i = 0; i < (n); i++) {
    d = 1000000000000000000;
    for (int j = 0; j < (m); j++) {
      l = (x[i] - a[j]) * (x[i] - a[j]) + (y[i] - b[j]) * (y[i] - b[j]);
      if (l < d) {
        d = l;
        ans = j + 1;
      }
    }
    cout << ans << endl;
  }
  return 0;
}
