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