program e(input,output);

var a, pocet, cislo, pocetZmen : integer;

begin

repeat
  readLn(pocet);
  if pocet=0 then halt(0); 
  pocetZmen:=0;
  for a:=1 to pocet do begin
    read(cislo);
    if cislo<>a then pocetZmen:=pocetZmen + 1;
  end;
  if (pocetZmen mod 3 = 0) or ((pocetZmen mod 2 = 0) and (pocetZmen>3)) then 
    WriteLn('Permutaci lze provest.')
  else
    WriteLn('Matfyzacci maji smulu.');    
    
  readLn;
until false; 


end.