#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 >> c[i] >> d[i];
  }
  for (int i = 0; i < n; i++) {
    int min = 10000000;
    int minP;
    for (int j = 0; j < m; j++) {
      int dummy = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (dummy < min) {
        min = dummy;
        minP = j + 1;
      }
    }
    cout << minP << endl;
  }
  return 0;
}
