#include <bits/stdc++.h>


int main(){
  std::cin >> N >> M;
  std::vector<long long> a(N), b(N), c(M), d(M);
  for(int i = 0; i < N; ++i){
    std::cin >> a[i] >> b[i];
  }
  for(int j = 0; j < M; ++j){
    std::cin >> c[j] >> d[j];
  }
  for(int i = 0; i < N; ++i){
    int count = -1;
    long long min_length= 1000000000000;
    for(int j = 0; j < M; ++j){
      length = std::abs(a[i]-c[j])+std::abs(b[i]-d[j]);
      if(min_length > length){
        min_length = length;
        count = j+1;
      }
    }
    std::cout << count << std::endl;
  }
}
~                                                                                                    
~                                                                                                    
~                                                                                                    
~              