int main(void){
    int N,M;
cin >> N >> M;
    const int NMMAX=50;
    int A[NMMAX],B[NMMAX],C[NMMAX],D[NMMAX];
1
8
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
    for(int i=0;i<N;++i){
        cin >> A[i] >> B[i];
}
    for(int j=0;j<M;++j){
        cin >> C[j] >> D[j];
    }
    for(int i=0;i<N;++i){
int min_dist=abs(A[i]-C[0])+abs(B[i]-D[0]),checkpoint=1;
for(int j=1;j<M;++j){
const int cur_dist=abs(A[i]-C[j])+abs(B[i]-D[j]); if(min_dist>cur_dist){
min_dist=cur_dist;
                checkpoint=j+1;
            }
}
        cout << checkpoint << endl;
    }
return 0; }