#include<bits/stdc++.h>
using namespace std;

int main(){
  int N,M;
  cin >> N >> M;
  vector<int> a(N);
  vector<int> b(N);
  vector<int> c(M);
  vector<int> d(M);
  for (int i = 0; i < N; i++){
    cin >> a.at(i) >> b.at(i);
  }
  for (int i = 0; i < M; i++){
    cin >> c.at(i) >> d.at(i) >> endl;
  }
  int A = 100000050,B = 100000050,C = 1000000050,D = 100000050;
  for (int i = 0; i < N; i++){
    for (int j = 0; j < M; j++){
      D = abs(a.at(i) - c.at(j)) + abs(b.at(i) - d.at(j));
      if (C > D){
        C = D;
        B = i;
      }
      if (A >= B){
        A = B;
      }
    }
    cout << A << endl;
  }
}