Welcome to ZOJ
Information
Select Problem
Runs
Ranklist
ZOJ Problem Set - 3151
Dice Compare

Time Limit: 1 Second      Memory Limit: 32768 KB

There are two dice and there is one number on each side. The range of number is [0, 9].

Now, I want to know whether these dice are
a) Same
b) Reflection
c) Different

If two dice are both Same and Reflection, we just think they are Same.

Each Dice will be given in its stretch out view. Just like these situation, or their rotation, reflection.


Input

First line is the number of cases. Each case gives two dice. Each one will be presented by a list of six numbers delimited with some spaces or line ends. But I promise it will always suit the situation which is given above. There are a blank line between two dice and two cases. And numbers in the same line are separated by one space.

Output

One line for each case, "Same", "Reflection" or "Different".


Sample Input

1
  1
2 3 4
  5
  6

  5
2 6 4
  1
  3

Sample Output

Same

Author: MIN, Zhechen
Source: ZOJ Monthly, January 2009
Submit    Status