#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  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];
  for (int i = 0; i < N; i++) {
    int dmin = 200, ans = 0;
    for (int j = 0; j < M; j++) {
      int s = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (s < dmin) {
        dmin = s;
        ans = j + 1;
      }
    }
    cout << ans << endl;
  }
}
