#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  long long r;
  while ((r = a % b) != 0) {
    a = b;
    b = r;
  }
  return b;
}
long long lcm(long long a, long long b) { return (a / gcd(a, b) * b); }
int main(void) {
  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];
  vector<int> dist(n, 10000005);
  vector<int> ans(n);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (dist[i] > abs(a[i] - c[j]) + abs(b[i] - d[j])) {
        dist[i] = abs(a[i] - c[j]) + abs(b[i] - d[j]);
        ans[i] = j + 1;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    cout << ans[i] << endl;
  }
  return 0;
}
