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

int N,M,i,j;
int x0[52],y0[52],x1[52],y1[52];

int main()
{
    cin>>N>>M;
    for(i=0;i<N;i++){
        cin>>x0[i]>>y0[i];
    }
    for(j=0;j<M;j++){
        cin>>x1[j]>>y1[j];
    }

    for(i=0;i<N;i++){
        int min_dist=abs(x0[i]-x1[0])+abs(y0[i]-y1[0]),index=1;

        for(j=0;j<M;j++){
          const int dist=abs(x0[i]-x1[j])+abs(y0[i]-y1[j]);
          if(min_dist>dist){
            min_dist=dist;
            index=j+1;
          }
        }
        cout<<index<<endl;
    }

    return 0;
}
