#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N, M;
  cin >> N >> M;
  vector<int> a(N), b(N);
  for (int i = 0; i < (N); i++) cin >> a[i] >> b[i];
  vector<int> c(M), d(M);
  for (int j = 0; j < (M); j++) cin >> c[j] >> d[j];
  for (int i = 0; i < (N); i++) {
    int res = 0;
    for (int j = (1); j < (M); j++) {
      if (abs(a[i] - c[j]) + abs(b[i] - d[j]) <
          abs(a[i] - c[res]) + abs(a[i] - d[res])) {
        res = j;
      }
    }
    cout << ++res << "\n";
  }
  return 0;
}
