Before we start, we need to declare a few definitions. MEX of a sequence is the smallest non-negative integer doesn't appears in the sequence. For example:
of is .
of is .
of is .
Subsequence The sequence is a subsequence of the sequence if and only if it can be obtained by deleting zero or more elements in without changing the order of the remaining elements. For example:
is a subsequence of of
is a subsequence of of
is not a subsequence of of
Hile has a sequence with length of . The -th element of is (i.e. ). Please help Hile calculate the sum of of all subsequences of . Since the answer may be very large, please output the answer modulo .
输入描述:
The first line contains an integer --- the number of test cases. Each test case is described by one integer --- the length of the sequence .
输出描述:
Output lines, each line contains an integer --- the answer modulo .