#include <bits/stdc++.h>
using namespace std;
int main(){
  int n,m;
  cin>>n>>m;
  vector<pair<long long int,long long int> > a(n+1),b(m+1);
  for(int i=1;i<=n;++i){
    cin>>a[i].first>>a[i].second;
  }
  for(int i=1;i<=m;++i){
    cin>>b[i].first>>b[i].second;
  }
  int f[m+1]={0};

  for(int i=1;i<=n;++i){
    unsigned long long int res=numeric_limits<unsigned long long int>::max();
    int index=-1;
    for(int j=1;j<=m;++j){
      if(f[j])continue;
      unsigned long long int a1=abs(a[i].first-b[j].first);
      unsigned  long long int a2=abs(a[i].second-b[j].second);
      unsigned long long int total=a1+a2;

      if(res>total){
        res=total;
        index=j;
      }
    }
    f[index]=1;
    cout<<index<<endl;
  }
  return 0;
}