Dragon

The Dragon curves are defined as follows.

Let D(0) be the string "Fa". For n≥1, let D(n) be the string derived from the string D(n-1) by replacing each copy of the character a by "aRbFR" and each copy of the character b by "LFaLb". For example, D(2) = "FaRbFRRLFaLbFR".

Each string D(n) can be used to draw a curve as follows. You start at location (0,0) facing towards the point (0,1). You go through the characters of D(n) interpreting each as an instruction:

Given n and s, we want to know where you will be if you follow the instructions of D(n) for s steps (where each F counts as a step but none of the other characters do). For example, D(10) is shown below. The highlighted spot at (18,16) is the position reached after 500 steps.

Input

The input will consist of multiple instances. The first line will contain a single integer m, giving the number of input instances. Then there will be m lines, each containing two non-negative integers n and s, where n ≤ 60 and s is at most the number of steps needed to draw D(n).

Output

For each pair n and s, give the location after s steps of constructing the curve described by D(n). The output should be printed on a separate line, starting with the x-coordinate, followed by a comma, followed by the y-coordinate with no spaces.

Sample Input

3
10 500
3 8
4 0

Sample Output

18,16
2,-2
0,0
[Based on a problem from the Euler Project]