program gen_same;

{$APPTYPE CONSOLE}

uses SysUtils;

const 
  MAXN = 1000;

var
  i, n, j, k, l: integer;
  s : string;
 
function min(x, y: integer):integer;
begin
	if (x<y) then result := x else result := y;
end; 
  
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;
  if (ParamCount > 1) then j := StrToInt(ParamStr(2)) else j := random(min(26,n)) + 1;
  
  l := n div j;
  
  for i:= 1 to j do begin
  	s := '';
  	for k := 1 to l do s := s + chr( ord('a') + i - 1 ); 
  	write(s);
  end;
  s := '';
  for i := 1 to n - l*j do  s := s + chr( ord('a') + j - 1 ); 
  
  write(s);
  
  sleep(50);
end.