#include <bits/stdc++.h>
using namespace std;
long long MD(pair<long long, long long> a, pair<long long, long long> b) {
  return abs(a.first - b.first) + abs(a.second - b.second);
}
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long n, m;
  cin >> n >> m;
  vector<pair<long long, long long> > s(n), c(m);
  for (long long(i) = 0; (i) < (n); (i)++) {
    cin >> s.at(i).first >> s.at(i).second;
  }
  for (long long(i) = 0; (i) < (m); (i)++) {
    cin >> c.at(i).first >> c.at(i).second;
  }
  long long log;
  for (long long(i) = 0; (i) < (n); (i)++) {
    long long min = 100000;
    for (long long(j) = 0; (j) < (m); (j)++) {
      if (MD(s[i], c[j]) < min) {
        min = MD(s[i], c[j]);
        log = j + 1;
      }
    }
    cout << log << endl;
    ;
  }
  return 0;
}
