#P1915B. Not Quite Latin Square
Not Quite Latin Square
No submission language available for this problem.
Description
A Latin square is a grid made up of the letters , , and such that:
- in each row, the letters , , and each appear once, and
- in each column, the letters , , and each appear once.
You are given a Latin square, but one of the letters was replaced with a question mark . Find the letter that was replaced.
The first line of the input contains a single integer () — the number of testcases.
Each test case contains three lines, each consisting of three characters, representing the Latin square. Each character is one of , , , or .
Each test case is a Latin square with exactly one of the letters replaced with a question mark .
For each test case, output the letter that was replaced.
Input
The first line of the input contains a single integer () — the number of testcases.
Each test case contains three lines, each consisting of three characters, representing the Latin square. Each character is one of , , , or .
Each test case is a Latin square with exactly one of the letters replaced with a question mark .
Output
For each test case, output the letter that was replaced.
Note
The correct Latin squares for the three test cases are shown below: