#include <bits/stdc++.h>
using namespace std;
const double pi = 2 * acos(0);
int main() {
  long long n, m;
  cin >> n >> m;
  vector<long long> a(n), b(n), c(n), d(n);
  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];
  for (long long i = 0; i < n; i++) {
    long long x, pos, mn = 1000000000;
    for (long long j = 0; j < m; j++) {
      x = fabs(a[i] - c[j]) + fabs(b[i] - d[j]);
      if (x < mn) {
        mn = x;
        pos = j;
      }
    }
    cout << pos + 1 << "\n";
  }
  return 0;
}
