```Description

Z-curve is a space-filling curve which is often used in computer science. Due to its good
locality preserving behaviour it is used in data structures for mapping multidimensional
data to one dimension. The figure below shows the z-values for the two dimentional case
with coordinates 1 <= x <= 8, 1 <= y <= 8.

Now here is your job: given coordinates (x,y), find its z-value; or given a z-value, find
the its coordinates (x,y).

Input

There are multiple test cases in the input. Each case is just a single line, containing either
two integers x and y with a pair of brackets, standing for coordinates (x,y), or just a single
integer z, standing for a z-value.

Output

For each case, output the cooresponding z-value, or coordinates, according to the input. Refer to
sample for the correct output format.

You may assume that all integers which appear in the input and output fit in positive signed 32-bit
integers.

Sample Input

(1,2)
(2,1)
50
(8,7)

Sample Output

3
2
(6,5)
62

Source

HIT song
```