Morgana is playing a game called cacti lottery. In this game, morgana has a $3 \times 3$ grid graph, and the graph is filled with $1$ ~ $9$ , each number appears only once. The game is interesting, he doesn't know some numbers, but there are also some numbers he knows but don't want to tell you.
Now he should choose three grids, these three grids should be in the same column or in the same row or in the diagonal line. Only after this choice, can he know all numbers in the grid graph. Then he sums the three numbers in the grids he chooses, get the reward as follows:
Then he wants you to predict the expected reward he will get if he is clever enough in the condition that he doesn't want to tell you something he knows.
("He is clever enough" means he will choose the max expected reward row or column or dianonal in the condition that he knows some numbers. And you know that he knows some number, but you don't know what they are exactly. So you should predict his expected reward in your opinion. )
First line contains one integers $T$ ($T \le 100$) represents the number of test cases.
Then each cases contains three lines, giving the $3 \times 3$ grid graph.
'*' means Morgana knows but doesn't want to tell you,
'#' means Morgana doesn't know,
'9' means the public number that Morgana and you both know.
$T$ lines, output the answer. If the answer is $A$, and your answer is $B$. Your answer will be considered as correct if and only if $|(A-B)| < 1e-5$ .
2 123 *** ### 12* 45# 78#