#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
ll a[50], b[50], c[50], d[50];
ll sq(ll x) { return x * x; }
ll d2(int i, int j) { return sq(a[i] - c[j]) + sq(b[i] - d[j]); }
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; ++i) cin >> a[i] >> b[i];
  for (int i = 0; i < m; ++i) cin >> c[i] >> d[i];
  for (int i = 0; i < n; ++i) {
    int k = 0;
    for (int j = 1; j < m; ++j) {
      if (d2(i, j) < d2(i, k)) k = j;
    }
    cout << k + 1 << '\n';
  }
}
