package main import "fmt" var mod int func fact(n int) int { if n == 0 { return 1 } return (n * fact(n-1)) % mod } func main() { mod = pow(10, 12) var n int fmt.Scan(&n) var ans int if n < 50 { ans = fact(n) } else { ans = 0 } if n < 15 { fmt.Println(ans) } else { fmt.Printf("%012d\n", ans) } } func pow(a, b int) int { res := 1 for range make([]struct{}, b) { res *= a } return res }