#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int N, M;
  cin >> N >> M;
  vector<pair<long long, long long> > stu(N);
  vector<pair<long long, long long> > check(M);
  for (int i = 0; i < N; i++) {
    long long a, b;
    cin >> a >> b;
    stu[i] = pair<long long, long long>(a, b);
  }
  for (int i = 0; i < M; i++) {
    long long c, d;
    cin >> c >> d;
    check[i] = pair<long long, long long>(c, d);
  }
  for (int i = 0; i < N; i++) {
    pair<long long, long long> ans = pair<long long, long long>(-1, 100000000);
    for (int j = 0; j < M; j++) {
      long long man = abs(check[j].first - stu[i].first) +
                      abs(check[j].second - stu[i].second);
      if (man < ans.second) {
        ans = pair<long long, long long>(j + 1, man);
      }
    }
    cout << ans.first << endl;
  }
  return 0;
}
