uses crt;
var z: char;
    x,y,c,n,a,b:integer;
begin
repeat
clrscr;
writeln('Trtkal 2008 - http://fei.trtkal.net');
writeln('-----------------------------------');
begin
     write('Kolik mam hledat cisel se souctem cifer 5?: '); readln(n);
     x:=0;
     y:=0;
     while x<n do
     begin
          c:=0;
          b:=y;
          a:=y mod 10;
          while (b div 10)>0 do
          begin
               b:=b div 10;
               c:=c+(b mod 10);
          end;
          if a+c=5 then
          begin
               x:=x+1;
               writeln(y:10);
          end;
          y:=y+1;
     end;
end;
writeln('----------');
write('Opakovat a/n: ');readln(z);
until (z='n');
end.