use proconio::input; fn main(){ input!{ a:u128, b:u128, c:u128, d:u128 } println!("{}",a * b * c % d) }