#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> a(N), b(N), c(M), d(M), ans(N);
  for (int i = 0; i < (N); i++) {
    cin >> a[i] >> b[i];
  }
  for (int i = 0; i < (M); i++) {
    cin >> c[i] >> d[i];
  }
  int sum, min = 1e+8;
  for (int i = 0; i < (N); i++) {
    for (int j = 0; j < (M); j++) {
      sum = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (min > sum) {
        min = sum;
        ans[i] = j + 1;
      }
    }
    min = 1e+8;
  }
  for (int i = 0; i < (N); i++) {
    cout << ans[i] << endl;
  }
}
