program sort3;
uses crt;
var plik : text;
wyniki : text;
a,b,c,v : integer;
aa,bb,cc: string;
poprawne: string;
begin
clrscr;
assign(plik,'c:\dane.txt');
reset(plik);
writeln('oryginalna kolejnosc to');
readln(plik, a, b, c);
writeln(a);
writeln(b);
writeln(c);
close(plik);
Writeln(' ');
Writeln('Kolejnosc rosnaca to');
if a>=b then if c>=a then writeln(b,' ',a,' ',c) else if b>=c then writeln(c,' ',b,' ',a) else writeln(b,' ',c,' ',a);
if a=b then writeln(a,' ',b,' ',c) else if c>=a then writeln(a,' ',c,' ',b) else writeln(c,' ',a,' ',b);
poprawne := '';
Str(a,aa);
Str(b,bb);
Str(c,cc);
if a>=b then if c>=a then poprawne := bb + ' ' + aa + ' ' + cc else if b>=c then poprawne := cc + ' ' + bb + ' ' + aa else poprawne := bb + ' ' + cc + ' ' + aa;
if a=b then poprawne := aa + ' ' + bb + ' ' + cc else if c>=a then poprawne := aa + ' ' + cc + ' ' + bb else poprawne := cc + ' ' + aa + ' ' + bb;
assign(wyniki,'wyniki.txt');
rewrite(wyniki);
Writeln(wyniki, poprawne);
close(wyniki);
readln;
end.