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