program gen_random;

{$APPTYPE CONSOLE}

uses SysUtils;

const
	MAXS = 99999999;
	MAX_DIGITS = 8;

var
  i, s: integer;
  pa, pb : double;

function get_big_rand : double;
 var
 	s: string;
 	i : integer;
begin
	s := '0.';
	s := s + chr(ord('0')+random(5)+5);
	for i := 1 to MAX_DIGITS-1 do
		s := s + chr(ord('0')+random(10));
	result := strtofloat(s);
end;

function get_small_rand : double;
begin
	result := (random(50)+50)/100;
end; 

function get_p : double;
begin
	result := get_big_rand;
end;

begin
	i:=1;
	while (FileExists(IntToStr(i)+'.in')) do inc(i);
	rewrite(output,IntToStr(i)+'.in');
	
  randomize;
  
  decimalseparator := '.';
  if paramcount > 0 then s := strtoint(paramstr(1)) else s := random(MAXS)+1;
  if paramcount > 1 then pa := strtofloat(paramstr(2)) else pa := get_p;
  if paramcount > 2 then pb := strtofloat(paramstr(3)) else pb := get_p;
  
  writeln(s);
  writeln(pa:0:MAX_DIGITS);
  writeln(pb:0:MAX_DIGITS);
  
  sleep(30);
end.