const DIVISOR: u64 = 10u64.pow(12); fn main() { let mut n = String::new(); std::io::stdin().read_line(&mut n).ok(); let n: u64 = n.trim().parse().unwrap(); if n >= 50 { println!("{}", "0".repeat(12)); } else { let mut answer = 1; let mut over = false; for i in 1..=n { answer *= i; if answer >= DIVISOR { over = true; answer %= DIVISOR; } } let answer = answer.to_string(); if over { println!("{}{}", "0".repeat(12 - answer.len()), answer); } else { println!("{}", answer); } } }