Statement
The esoteric programming language BrainF**k is written using only the eight characters +-][><,..
>: Increase the pointer by .<: Decrease the pointer by .+: Increase the value at the current pointer by .-: Decrease the value at the current pointer by ..: Output the value at the current pointer as an ASCII character.,: Read one character and overwrite the value at the current pointer with its ASCII code.[: If the byte at the current pointer is , jump to the matching].]: If the byte at the current pointer is not , jump to the matching[.
The characters [ and ] denote the beginning and end of loops. Compilation fails if and only if these brackets are not properly matched.
A cat walks on the keyboard. At every step, it types one uniformly random character from +-][><,..
Given an integer , find the probability that the length- string typed after exactly steps can be compiled as BrainF**k code.
Input
The input is given from Standard Input in the following format:
Each case is given in the following format:
Output
For each test case, print the answer on one line.
Write the probability for that test case as a reduced fraction . The denominator is not divisible by . Let be the multiplicative inverse of modulo . Print
as an integer between and , inclusive.
Constraints
- .
- .
Subtasks
Samples
For the first test case, the program compiles exactly when one of the six non-bracket characters is typed. The probability is , which is modulo .