import std.stdio, std.string, std.array, std.conv, std.algorithm, std.typecons, std.range, std.container, std.math, std.algorithm.searching, std.functional,std.mathspecial;

void main(){
    auto nm=readln.split.map!(to!int).array;
    int[][] abs;
    foreach(i;0..nm[0])abs~=readln.split.map!(to!int).array;
    int[][] cds;
    foreach(i;0..nm[1])cds~=readln.split.map!(to!int).array;

    foreach(ab;abs){
        writeln(1+cds.minIndex!((currentMax,cd)=> dis(cd,ab)>dis(currentMax,ab)));
    }
}

double dis(int[]a,int[]b){
    return abs(a[0]-b[0])+abs(a[1]-b[1]);
}
