#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
  int n, m;
  cin >> n >> m;
  const int INF = 100000008;
  vector<P> s(n), p(m), ans(n, make_pair(0, INF));
  for (int i = 0; i < (int)(n); i++) {
    int a, b;
    cin >> a >> b;
    s[i] = make_pair(a, b);
  }
  for (int i = 0; i < (int)(m); i++) {
    int c, d;
    cin >> c >> d;
    p[i] = make_pair(c, d);
  }
  for (int i = 0; i < (int)(n); i++) {
    ll x1 = s[i].first;
    ll y1 = s[i].second;
    for (int j = 0; j < (int)(m); j++) {
      ll x2 = p[j].first;
      ll y2 = p[j].second;
      ll d = abs(x1 - x2) + abs(y1 - y2);
      if (ans[i].second > d) {
        ans[i].first = j + 1;
        ans[i].second = d;
      }
    }
  }
  for (int i = 0; i < (int)(n); i++) {
    cout << ans[i].first << endl;
  }
  return 0;
}
