var
i,j,k,m,n,x:longint;
a,b,c,d:array[1..1000]of longint;
begin
    readln(m,n);
    for i:=1 to m do
    readln(a[i],b[i]);
    for j:=1 to n do
    readln(c[i],d[i]);
    for i:=1 to m do
    begin
        k:=maxlongint;
        for j:=1 to n do
        if abs(a[i]-c[j])+abs(b[i]-d[j])<k then
        begin k:=abs(a[i]-c[j])+abs(b[i]-d[j]);x:=j; end;
        writeln(x);
    end;
end.
