#include <bits/stdc++.h>
using namespace std;
using ll = long long;
void solve(long long N, long long M, std::vector<pair<ll, ll>> s,
           std::vector<tuple<ll, ll, int>> c) {
  sort(c.begin(), c.end());
  for (int i = 0; i < N; i++) {
    ll minDist = numeric_limits<ll>::max();
    ll res = -1;
    for (int j = 0; j < c.size(); j++) {
      auto curr = c[j];
      ll dist =
          abs(s[i].first - get<0>(curr)) + abs(s[i].second - get<1>(curr));
      if (dist < minDist) {
        minDist = dist;
        res = get<2>(curr);
      }
    }
    cout << res << endl;
  }
}
int main() {
  ll N, M;
  cin >> N >> M;
  std::vector<pair<ll, ll>> s(N);
  for (int i = 0; i < N; i++) {
    ll a, b;
    cin >> a >> b;
    s[i] = {a, b};
  }
  std::vector<tuple<ll, ll, int>> c(M);
  for (int i = 0; i < M; i++) {
    ll a, b;
    cin >> a >> b;
    c[i] = {a, b, i + 1};
  }
  solve(N, M, std::move(s), std::move(c));
  return 0;
}
