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