program gen_random;

{$APPTYPE CONSOLE}

uses SysUtils;

const
  MAXN = 1000000000;

var
  i: integer;
  
begin
	i:=1;
	while (FileExists(IntToStr(i)+'.in')) do inc(i);
	rewrite(output,IntToStr(i)+'.in');
	
  randomize;
  
  if (ParamCount > 0) then write(ParamStr(1))
  else write(random(MAXN)+1);
  
  sleep(100);
end.