题目描述
Raju remembers his childhood days and it reminds him of his favourite game 'Find the pattern'. He memorizes that there is a problem pattern and there are four options available. He had to choose the correct pattern from the options that fits correctly with the problem pattern and when both are merged together they form a square. Also, that game contains difficult problems in which first he has to rotate the problem pattern and then find the correct option.
Given a problem pattern and four options, find the correct option that fits exactly with the problem pattern and forms a square of 10 × 10. The problem pattern can be rotated through 90 degrees, 180 degrees or 270 degrees as required.
Note:
All the patterns contains characters 'X' and '_'.
Input
The first line of the input contains an integer T denoting the number of test cases. The description of T test cases follows.
Each test case contains five patterns of size 10 × 10 characters.There is a blank line after each pattern.
The first pattern is the problem pattern and the next four patterns are options to the solution. One of these four patterns is the solution to the first pattern.
Output
For each test case print the relative position of the correct option from the problem pattern.
Constraints
1 ≤ T ≤ 100
SAMPLE INPUT
1
X_X_
X_X_
X_X_
X_X__X
X_X___XX
X_XX_X_XXX
X_XX_X_XXX
XXXXXXXXXX
XXXXXXXXXX
XXXXXXXXXX
XXXXXXXXXX
XXXXX_XXXX
XXXXX_XXXX
_XX_XXX
XXXXX
_XX____X
_X_X
_X__
X_
XXXXXXX___
XXXXXXXX
XXXXXXXXX_
XXXXXXX
XXX_
XXX_
XXXXX__
XXXX__
XXXX____
___X
__XXXXXXXX
___X
_XXXXXX
_XXXXXXXX
__XXXXXX
__XXXXXXXX
_XXXXXX
__XXXXX
______XXXX
__XX
_XXXXXX
_XXX
XXXX
_XXXXXXXX
_X
__XXXX
_XXXX
_XXXXXX
___XXXXXXX
SAMPLE OUTPUT
3
输入格式
见题面
输出格式
见题面