#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
int main(void){
  int N,M;
  cin >> N >> M;
  
  vector<vector<int>>person(N,vector<int>(2,0));
  for(int i=0;i<N;i++){
    cin >> person[i][0];
    cin >> person[i][1];
  }
  
  vector<vector<int>>point(M,vector<int>(2,0));
  for(int i=0;i<M;i++){
    cin >> point[i][0];
    cin >> point[i][1];
  }

  for(int i=0;i<N;i++){
    int distance_to_point = 1000000000;
    int ans;
    for(int i=0;i<M;i++){
      int distance = abs(person[i][0] - point[j][0]) + abs(person[i][1] - point[j][1]);
      if(distance_to_point > distance){
        distance_to_point = distance;
        ans = j + 1;
      }
    }
    cout << ans << endl;
  }
  
  return 0;
}
