fun fact (n) { if n <= 1 then return 1 else return n * fact (n-1) fi } n := read (); for i := n, i >= 1, i := i-1 do write (i); write (fact (i)) od