Hakurei Reimu is good at playing maimai DX.
In maimai DX, there are $$$8$$$ touch-sensitive buttons arranged in a circular layout around the screen. We number them from $$$1$$$ to $$$8$$$ (picture 1).
picture 1 One day, Reimu is studying simai language. We always use simai language to describe a slide. A slide contains three parts: starting point, ending point, and sliding path.
There are 4 kinds of slides in maimai DX:
For example, there are $$$4$$$ slides in picture 6: $$$1 \gt 3,3\lor 5,1 \lt 7,7\lor 5$$$.
picture 6 Now we assume the radius of the maimai DX circle is $$$50$$$cm. Given a slide $$$x?y$$$, can you tell me the length of the slide?
The first line consists of a positive integer $$$T\ (1\le T\le 10^5)$$$.
The next $$$T$$$ lines, each line contains $$$x?y\ (1\le x,y\le 8,\ x \neq y,\ ?\in\{-$$$, >, <, v$$$\})$$$.
Please note that we use the lowercase letter "v" instead of "$$$\lor$$$" in our input.
$$$T$$$ lines, each line outputs the length of the slide.
The absolute or relative error within $$$10^{-6}$$$ is considered correct: Assuming the correct answer is $$$a$$$, your answer is $$$b$$$. It will be considered correct as long as $$$\frac{| a-b |}{max (a, 1)}\le 10^{-6}$$$.
4 1-4 2>5 3<6 1v3
92.3879532511 117.8097245096 196.3495408494 100.0000000000
Here are picture 2, picture 3, picture 4, and picture 5 from left to right:
![]() | ![]() | ![]() | ![]() |
| Name |
|---|


