#include <bits/stdc++.h>
using namespace std;
using Pos = pair<int, int>;
inline int distance(const Pos& a, const Pos& b) {
  return abs(a.first - b.first) + abs(a.second - b.second);
}
int INF = 100100100;
int main() {
  int N, M;
  cin >> N >> M;
  vector<Pos> ps(N);
  for (int i = 0; i < N; ++i) {
    cin >> ps[i].first >> ps[i].second;
  }
  vector<Pos> as(M);
  for (int i = 0; i < M; ++i) {
    cin >> as[i].first >> as[i].second;
  }
  auto pos_no = [&as](const Pos& p) {
    int mind = INF;
    int idx = 0;
    for (int i = 0; i < as.size(); ++i) {
      auto d = distance(p, as[i]);
      if (d < mind) {
        mind = d;
        idx = i;
      }
    }
    return idx + 1;
  };
  for (auto p : ps) {
    cout << pos_no(p) << endl;
  }
  return 0;
}
