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