use std::io::Read; fn p(mut r: u64, mut n: u64, d: u64) -> u64 { let mut a = 1; while n > 0 { if n & 1 == 1 { a = a * r % d; } r = r * r % d; n >>= 1; } a } fn main() { let mut s = String::new(); std::io::stdin().read_to_string(&mut s).ok(); let n: Vec = s.split_whitespace().flat_map(str::parse).collect(); let d = 1000000007; println!("{}", p(n[0] * n[1] % d * n[2] % d, p(2, n[3], d - 1), d)) }