#includ/bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using  namespace std;

int absolute_value(int n){
  if(n >= 0) return n;
  if(n < 0) return -n;
}

int main(){
  int N,M;
  cin >> N >> M;
  vector<vector<int>> student(N, vector<int>(2));
  vector<vector<int>> check_point(N, vector<int>(2));
  rep(i, N){
    cin >> student[i][0] >> student[i][1];
  }
  rep(i, M){
    cin >> check_point[i][0] >>check_point[i][1];
  }
  
  rep(i, N){    
    int min_d = 0;
    int P;
    rep(j, M){     
      int d;
      d = absolute_value(student[i][0]-check_point[j][0]) + absolute_value(student[i][1]-check_point[j][1]);
      if(d < min_d){
        min_d = d;
        P = i+1
      }
    }
    cout << P << endl;
  }
}
      
      
  