fn power(base: usize, m: usize) -> usize { if m == 0 { return 1; } if m == 1 { return base; } const DENOM: usize = 1_000_000_007; let val: usize = power(base, m / 2); return (val * val) % DENOM * power(base, m % 2) % DENOM; } // TODO fn main() { let mut n = String::new(); std::io::stdin().read_line(&mut n).ok(); let n: usize = n.trim().parse().unwrap(); const DENOM: usize = 1_000_000_007; // 4 * 10^n - 1 let mut result = 4 * power(10, n) + DENOM - 1; result %= DENOM; // div 3 -> a ^ (p-1) ≡ 1 mod p より(フェルマーの小定理) result *= power(3, DENOM - 1 - 1) % DENOM; result %= DENOM; println!("{}", result); }