#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m;
  cin >> n >> m;
  pair<long long, long long> a[n], b[n];
  for (long long i = 0; i < n; i++) cin >> a[i].first >> a[i].second;
  for (long long i = 0; i < m; i++) cin >> b[i].first >> b[i].second;
  for (long long i = 0; i < n; i++) {
    vector<pair<long long, long long> > vc;
    for (long long j = 0; j < m; j++) {
      long long d =
          abs(a[i].first - b[j].first) + abs(a[i].second - b[j].second);
      vc.push_back(make_pair(d, j + 1));
    }
    sort(vc.begin(), vc.end());
    cout << vc[0].second << endl;
    ;
  }
  return 0;
}
