#include <bits/stdc++.h>
using namespace std;
const long long INF = 1000000000;
signed main(void) {
  int n, m, ans, sum, dis;
  cin >> n >> m;
  pair<long long, long long> p[n], q[n];
  for (int i = 0; i < (n); i++) cin >> p[i].first >> p[i].second;
  for (int i = 0; i < (m); i++) cin >> q[i].first >> q[i].second;
  for (int i = 0; i < (n); i++) {
    sum = INF;
    for (int j = 0; j < (m); j++) {
      dis = abs(p[i].first - q[j].first) + abs(p[i].second - q[j].second);
      if (sum >= dis) {
        sum = dis;
        ans = j + 1;
      }
    }
    cout << ans << endl;
  }
  return 0;
}
