#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(n), b(n);
  vector<int> c(m), d(m);
  for (long long i = 0; i < n; i++) cin >> a[i] >> b[i];
  for (long long i = 0; i < m; i++) cin >> c[i] >> d[i];
  vector<int> ans(n);
  int min = 100000000;
  int dis;
  int index = -1;
  for (int i = 0; i < n; i++) {
    min = 100000000;
    index = -1;
    for (int j = 0; j < m; j++) {
      dis = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (min > dis) {
        min = dis;
        index = j;
      }
    }
    ans[i] = index + 1;
  }
  for (long long i = 0; i < n; i++) cout << ans[i] << endl;
  return 0;
}
