Submit solution

Points:
10 (partial)

Time limit:
1.0s

Memory limit:
64M

Author:

Problem types

Allowed languages

Ada, Assembly, Awk, Brain****, C, C#, C++, COBOL, ~~CommonLisp~~, D, Dart, F#, Forth, Fortran, Go, ~~Groovy~~, Haskell, Intercal, Java, JS, Kotlin, Lisp, Lua, ~~Nim~~, ~~ObjC~~, OCaml, ~~Octave~~, Pascal, Perl, PHP, Pike, Prolog, Python, Racket, Ruby, Rust, Scala, Scheme, Sed, Swift, TCL, Text, Turing, VB, Zig

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 and , how many ways are there to make an integer array of length where such that:

- ?
- ?
- ?

Note that:

- denotes the bitwise
`xor`

operation (`^`

in most languages). - denotes the bitwise
`or`

operation (`|`

in most languages). - denotes the bitwise
`and`

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 space-separated integers .

#### 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 4 [60%]

##### Subtask 5 [20%]

No further constraints.

#### Sample Input 1

`2 1000000007 3 5`

#### Sample Output 1

```
8
9
3
```

#### Sample Input 2

`8 1000000007 1 0`

#### Sample Output

```
128
1
255
```

## Comments