Reduce to one
Consider a list of integers . Initially contains the integers through , each of them exactly once (but it may contain multiple copies of some integers later). The order of elements in is not important. You should perform the following operation times:
Choose two elements of the list, let's denote them by and . These two elements may be equal.
Erase the chosen elements from .
Append the number to .
At the end, contains exactly one integer. Find the maximum possible value of this integer. Since the answer may be large, compute it modulo .
Input
The first line contains the number of test cases . Each of the next lines contains a single integer .
Output
For each test case, print a single line containing one integer — the maximum possible value of the final number in the list modulo .