#include <bits/stdc++.h>
using namespace std;
template <class T>
void cout_vec(const vector<T> &vec) {
  for (auto itr : vec) cout << itr << ' ';
  cout << endl;
}
const long long mod = 1e9 + 7;
const long long inf = 1e15;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  vector<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++) {
    long long cnt = inf;
    long long ans;
    for (long long j = 0; j < m; j++) {
      if (cnt > abs(a[i].first - b[j].first) + abs(a[i].second - b[j].second)) {
        ans = j + 1;
        cnt = abs(a[i].first - b[j].first) + abs(a[i].second - b[j].second);
      }
    }
    cout << ans << endl;
  }
}
