let input:[Int64] = readLine()!.split(separator: " ").map{Int64($0)!} let output:Int64 = (input[0] * input[1] * input[2]) % input[3] print(output)