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 = 0 } else { ans = fact(n) } fmt.Printf("%012d\n", ans) } func pow(a, b int) int { res := 1 for range make([]struct{}, b) { res *= a } return res }