#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b != 0 ? gcd(b, a % b) : a; }
long long lcm(long long a, long long b) { return a * b / gcd(a, b); }
int main() {
  long long n, m;
  cin >> n >> m;
  vector<long long> a(n), b(n), c(m), d(m), ans(n, -1);
  for (long long i = 0; i < (long long)(n); i++) cin >> a[i] >> b[i];
  for (long long i = 0; i < (long long)(m); i++) cin >> c[i] >> d[i];
  for (long long i = 0; i < (long long)(n); i++) {
    long long mn = 1e9;
    for (long long j = 0; j < (long long)(m); j++) {
      long long manh = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (mn > manh) {
        mn = manh;
        ans[i] = j;
      }
    }
  }
  for (long long i = 0; i < (long long)(n); i++) cout << ans[i] << endl;
  return 0;
}
