#include <iostream>
#include <vector>
#include <alogorithm>

using namespace std;
using ll = long long int;
using pll = pair<ll,ll>;

ll dist(pll a, pll b){
  return max(abs(a.first-b.first),abs(a.second-b.second));
}

int main(){
  int n,m; cin >> n >> m;
  vector<pll> stu,chk;
  for(int i=0;i<n;i++){
  	ll a,b; cin >> a >> b;
    stu.emplace_back(a-b,a+b);
  }
  for(int i=0;i<m;i++){
  	ll a,b; cin >> a >> b;
    chk.emplace_back(a-b,a+b);
  }
  vector<int> ans;
  for(int i=0;i<n;i++){
    vector<pll> dsc;
    for(int j=0;j<m;j++){
      dsc.emplace_back(dist(stu[i],chk[j]),j+1);
    }
    auto itr = min_element(dsc.begin(),dsc.end());
    ans.push_back(itr->second);
  }
  for(auto a:ans) cout << a << "\n";
  return 0;
}