#include <bits/stdc++.h>
using namespace std;
const int INF = 100000000;
const int MOD = 1000000007;
int main() {
  int n, m;
  std::cin >> n >> m;
  vector<long long> 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];
  for (int i = 0; i < (int)(n); i++) {
    long long dist = INF, dum = 0, num;
    for (int j = 0; j < (int)(m); j++) {
      dum = 0;
      dum += abs(c[j] - a[i]) + abs(d[j] - b[i]);
      if (dist > dum) {
        dist = dum;
        num = j + 1;
      }
    }
    std::cout << num << std::endl;
  }
}
