const MOD: usize = 1e9 as usize + 7; fn power(base: usize, times: usize) -> usize { if times == 0 { return 1usize; } if times == 1 { return base; } let temp = power(base, times/2); temp * temp % MOD * power(base, times%2) % MOD } fn main() { let mut n = String::new(); std::io::stdin().read_line(&mut n).ok(); let n: usize = n.trim().parse().unwrap(); if n == 1 { println!("2"); return; } let mut result = if n % 2 == 1 { 3 } else { 1 }; if n > 1 { result *= 4; } if n > 3 { result *= power(5, n / 2 - 1); } result %= MOD; println!("{}", result); }