type
	a=array[0..99] of integer;
var
	ar:a;
	i, max , ran: integer;
	ans, rans:(*boolean*)integer;
const
	n=100;

function InArray(a:array of integer; r:integer):boolean;
	begin
		InArray:=false;
		i:=Low(a);	
		while (i<=High(a) ) or ( InArray <> true ) do
			begin
				if r=a[i] then InArray:=true;
				inc(i);
		end;
	end;

begin
	randomize;
	max:=0;
	ans:=0;
	rans:=1;
	for i:=0 to 99 do
	begin
		ar[i]:=0;
	end;

	for i:=0 to 99 do
	begin
		ran:=random(10001);
		while InArray(ar, ran)=true do
		begin
			ran:=random(10001);
		end;
		
		ar[i]:=ran;
		
		if ar[i]> max then max:=ar[i];
	end;
		
	i:=0;
		
	while  (i<100) and (ans<1)  do
	begin
		WriteLn(ar[i]);
		ReadLn(ans);
		if ans<1 then 
			if ar[i]<max then rans:=0;
		inc(i);
	end;
	write(rans);
	read(i);
end.