#include <iostream>
#include <vector>
#include <map>

using namespace std;

int main(){
  int N, M;
  cin >> N >> M;
  
  vector<pair<long long int, long long int>> Students(N);
  vector<pair<long long int, long long int>> Points(N);
  
  for(int i = 0;i < N; i++){
    long long int a, b;
    cin >> a >> b;
    Students[i] = make_pair(a, b);
  }
  
  for(int i = 0;i < M; i++){
    long long int a, b;
    cin >> a >> b;
    Points[i] = make_pair(a, b);
  }
  
  vector<int> ans;
  
  for(int i = 0; i < N; i++){
    long long int tdist = 1000000000, tptnr = 100;
    for(int j = 0; i < M; j++){
      int td, tp;
      td = abs(Students[i].first - Points[j].first);
      tp = j+1;
      if(td < tdist) td = tdist, tptnr = tp;
      else if(td == tdist) tptnr = tp;
      else continue;
    }
    ans.push_back(tp);
  }
  
  for(int i = 0; i < N; i++) cout << ans[i] << endl;
}