program gen_random;

{$APPTYPE CONSOLE}

uses SysUtils;

const
  maxp = 147;

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(maxp)+1);
  
end.