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