"În viață câștigi sau pierzi
Omenia s-o păstrezi, măi"
A trader keeps a daily log of trading results. Each day is recorded as either a winning day (W) or a losing day (L). Over a period of trading days, the trader records exactly winning days and losing days.
A winning streak is any non-empty contiguous subsequence of days such that every day in that interval is a win (W). Two streaks are considered different if they correspond to different intervals.
Task
Compute the total sum of winning streaks over all valid sequences, modulo .
Formally, let be the set of all sequences of length containing exactly characters W and characters L. Then the answer is:
where
Input data
The first line of the input contains a single integer , representing the number of queries.
Each of the next lines contains a single integer .
Output data
For each query, output a single line containing the answer corresponding to that value of , modulo .
Constraints and clarifications
Example
stdin
2
1
2
stdout
2
15
Explanation
For , the possible sequences are:
WLstreakLWstreak
Total:
For , all sequences and their number of winning streaks:
WWLLWLWLWLLWLWWLLWLWLLWW
Total: