#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ll N, M;
  cin >> N >> M;
  vector<pair<ll, ll>> student(N);
  vector<pair<ll, ll>> check(M);
  for (ll i = 0; i < N; i++) {
    cin >> student[i].first >> student[i].second;
  }
  for (ll i = 0; i < M; i++) {
    cin >> check[i].first >> check[i].second;
  }
  for (ll i = 0; i < N; i++) {
    pair<ll, ll> point = make_pair(abs(student[i].first - check[0].first) +
                                       abs(student[i].second - check[0].second),
                                   0);
    for (ll j = 0; j < M; j++) {
      ll distance = abs(student[i].first - check[j].first) +
                    abs(student[i].second - check[j].second);
      if (distance < point.first) {
        point = make_pair(distance, j);
      }
    }
    cout << point.second << endl;
  }
  return 0;
}
