#include <bits/stdc++.h>
int main() {
  long long N, M;
  std::cin >> N >> M;
  std::vector<long long> a(N);
  std::vector<long long> b(N);
  std::vector<long long> c(M);
  std::vector<long long> d(M);
  for (long long i = 0; i < N; ++i) std::cin >> a[i] >> b[i];
  for (long long i = 0; i < M; ++i) std::cin >> c[i] >> d[i];
  for (long long i = 0; i < N; ++i) {
    long long dmin = 100000000;
    long long p = 0;
    for (int j = 0; j < M; ++j) {
      if (dmin > std::abs(a[i] - c[j]) + std::abs(b[i] - d[j])) p = j + 1;
      dmin = std::min(dmin, std::abs(a[i] - c[j]) + std::abs(b[i] - d[j]));
    }
    std::cout << p << std::endl;
  }
  return 0;
}
