#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9;
const long long MOD = 1e9 + 7;
const double EPS = 1e-9;
const double PI = acos(-1.0);
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout << fixed << setprecision(15);
  long long N, M;
  cin >> N >> M;
  vector<pair<long long, long long>> A(N);
  vector<pair<long long, long long>> B(M + 1);
  for (long long i = (0); i < (long long)(N); ++i) {
    long long x, y;
    cin >> x >> y;
    A[i] = make_pair(x, y);
  }
  for (long long j = (1); j < (long long)(M + 1); ++j) {
    long long x, y;
    cin >> x >> y;
    B[j] = make_pair(x, y);
  }
  for (long long i = (0); i < (long long)(N); ++i) {
    long long sx = A[i].first, sy = A[i].second;
    long long ans = 0;
    long double min_d = INF;
    for (long long j = (1); j < (long long)(M + 1); ++j) {
      long long tx = B[j].first, ty = B[j].second;
      long double d = sqrt(pow((tx - sx), 2) + pow((ty - sy), 2));
      if (d < min_d) {
        min_d = d;
        ans = j;
      }
    }
    cout << ans << "\n";
  }
}
