#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  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 dist = 1e9;
    int ans = -1;
    for (int j = 0; j < n; j++) {
      int cost = abs(A[i] - C[j]) + abs(B[i] - D[j]);
      if (dist > cost) {
        dist = cost;
        ans = j + 1;
      }
    }
    if (ans == -1)
      cout << "aaaaaaaaaa" << endl;
    else
      cout << ans << endl;
  }
  return 0;
}
