using System; namespace FactCalc { class Program { static void Main(string[] args) { Decimal n = Decimal.Parse(Console.ReadLine()); Decimal f = Ncalc(n); Console.WriteLine( Formater(f) ); } private static string Formater(decimal f) { string s = f.ToString("#"); if (s.Length > 12) s = s.Substring(s.Length - 12, 12); return s; } private static decimal Ncalc(decimal n) { if (n - 1 < 2) return n; return Ncalc(n - 1) * n; } } }