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