August is doing his binary math homework. While doing it, he came up with a problem, and thought it would be a good problem to put on the GlobeX Canada Cup.
August gives you 3 questions. Given the integers
? ? ?
Note that:
denotes the bitwisexor
operation (^
in most languages). denotes the bitwiseor
operation (|
in most languages). denotes the bitwiseand
operation (&
in most languages).
Since August has meganumerophobia, he wants the answer to each question modulo
Input Specification
The first line and only line will contain
Output Specification
On the first line, output the answer to question 1, modulo
On the second line, output the answer to question 2, modulo
On the last line, output the answer to question 3, modulo
Subtasks
Subtask 1 [5%]
Subtask 2 [15%]
Subtask 3 [60%]
Subtask 4 [20%]
No additional constraints.
Sample Input 1
Copy
2 1000000007 3 5
Sample Output 1
Copy
8
9
3
Sample Input 2
Copy
8 1000000007 1 0
Sample Output 2
Copy
128
1
255
Comments