#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  vector<long long> a(n), b(n), c(m), d(m), dist(m);
  vector<int> ans(n), tem(m);
  for (int i = (0); i < (n); i++) cin >> a[i] >> b[i];
  for (int j = (0); j < (m); j++) cin >> c[j] >> d[j];
  for (int i = (0); i < (n); i++) {
    int temp = 10000000000;
    for (int j = (0); j < (m); j++) {
      dist[j] = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (dist[j] < temp) {
        temp = dist[j];
        ans[i] = j;
      } else if (dist[j] == temp) {
        ans[i] = min(tem[j], j);
      }
    }
  }
  for (int i = (0); i < (n); i++) cout << ans[i] + 1 << endl;
  return 0;
}
