#include<bits/stdc++.h>
using namespace std;

int dn(int a,int b,int c,int d){
  return abs(c-a)+abs(d-b);
}

int main(){
  int n,m,i,j;
  cin>>n>>m;
  int a[n],b[n],c[m],d[m];
  for(i=0;i<n;i++){
    cin>>a[i]>>b[i];
  }
  for(i=0;i<m;i++){
    cin>>c[i]>>d[i];
  }
  int m[n];
  for(i=0;i<n;i++){
    m[i]=0;
    for(j=0;j<m;j++){
      if(dn(a[i],b[i],c[j],d[j])<dn(a[i],b[i],c[m[i]],d[m[i]]))m[i]=j;
      else if(dn(a[i],b[i],c[j],d[j])==dn(a[i],b[i],c[m[i]],d[m[i]])){
      	if(j<m[i])m[i]=j;
      }
    }
  }
  for(i=0;i<m;i++){
    cout<<m[i]<<endl;
  }
}