#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr ll INF = 3000000000000000000;
int main() {
  int N, M;
  cin >> N >> M;
  vector<ll> 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 ans = 0;
    ll d = INF;
    for (int j = 0; j < (M); ++j) {
      if (abs(A[i] - C[j]) + abs(B[i] - D[j]) < d) {
        ans = j + 1;
        d = abs(A[i] - C[j]) + abs(B[i] - D[j]);
      }
    }
    cout << ans << "\n";
  }
  return 0;
}
