#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  std::cin >> n >> m;
  std::vector<int64_t> a(n), b(n), c(m), d(m);
  for (int i = 0; i < (int)(n); i++) std::cin >> a[i] >> b[i];
  for (int i = 0; i < (int)(m); i++) std::cin >> c[i] >> d[i];
  std::vector<int> v(n);
  for (int i = 0; i < (int)(n); i++) {
    int64_t minv = 100000001;
    for (int j = 0; j < (int)(m); j++) {
      uint64_t tmp = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (minv > tmp) {
        minv = tmp;
        v[i] = j + 1;
      }
    }
  }
  for (int i = 0; i < (int)(n); i++) {
    std::cout << v[i] << std::endl;
  }
  return 0;
}
