program gen_random;

{$APPTYPE CONSOLE}

uses SysUtils;

const 
  MAXN = 1000;

var
  i, n: integer;
  s : string;
  
begin
	i:=1;
	while (FileExists(IntToStr(i)+'.in')) do inc(i);
	rewrite(output,IntToStr(i)+'.in');
	
  randomize;
  
  if (ParamCount > 0) then n := StrToInt(ParamStr(1)) else n := random(MAXN) + 1;
  
  for i:= 1 to n do s := s + chr(ord('a') + random(26));
  
  write(s);
  
  sleep(50);
end.