Bob learned about functions in mathematics class. He considers a function satisfying the following conditions.
For any real numbers ,
and
Bob wants to know for positive integers . Answer his queries.
The input is given in the following format:
For each query, print modulo on its own line, in order.
The answers in order are , , , and .
The first line contains the number of queries .
Each of the next lines contains one positive integer for the -th query, written in decimal without leading zeros.
| 2 | 30 | (). |
| 3 | 50 | No additional constraints. |