You are given an array of length , consisting only of , , and .
Repeat the following operation until the length of the array becomes .
Suppose the current length is . Construct a new array of length by
and replace with .
Find the single value that remains at the end.
The input is given from Standard Input in the following format:
For each test case, print the final remaining value on one line.
The array changes as follows.
Therefore, the final remaining value is .
Each case is given in the following format:
| 3 | 48 | No additional constraints. |