Problem Description
Recently, Mr. Maple feels it more and more boring to check the students' homework, especially those with multiple choice questions. Then he emerges an idea of using computer to help him check the answers. So that Mr. Maple needs a program, which can recognize what letters the students filled in after the answer sheets are scanned into the computer.
So far, the answer sheets have been transfered into square-like patterns (refer to the sample), in which ‘X’ presents the painted pixel, and ‘.’ presents blank. It’s your turn to write a program for recognition. Go!

• Some details about the patterns: 1) The size of patterns is always 16 * 16. 2) Each pattern can have one and only one character. 3) The character belongs to {A, B, C, D}. 4) The written character won’t be too small. 5) The character may be distorted or rotated (a little). 6) Redundant pixels would turn up in a few cases. 7) Necessary pixels would be missing in a few cases. 8) It is guaranteed that all the test data can be easily judged by eye.

Input
The first line contains the number T of testcases (1 ≤ T ≤ 50). Then T patterns below.
Note that there is a blank line between the patterns.

Output
For each pattern print a line consisting of the corresponding character.

Sample Input
3
................
........X.......
.......XX.......
......X..X......
.....XX..X......
.....X...X......
....XX...X......
....X....X......
...X.....XX.....
...XXXXXXXXXX...
..XX......XX....
..XX.......X....
..XX.......XX...
..XX........X...
.XXX.X.......XX.
................

..X.............
................
......XXXXXX....
............X...
.....XX......XX.
.....X.......XXX
....XX........X.
....X.........X.
...X.....XX..X..
...XXXXXXXXX....
...X......XX.X..
..X...........X.
..X...........X.
..X.........XX..
.XXXXXXXXXXX....
................

................
................
................
.........XXX....
......X.........
...XX...........
.XX.............
X...............
X...............
.XX.............
.XX.........X...
...XX.XXXXXXX...
.....XXXXXXX....
................
................
................

Sample Output
A
B
C

0

c语言实现统计每个字符的个数

C语言实现由*组成的多行规则多边形图案的输出

Python程序-打印单词的菱形字符图案

I00005 打印直角三角形字符图案

------如何取得只由字符组成的文本-----

c/c++语言打印由*组成的五角星

C语言打印字符图形
C语言打印字符图形，有关C语言中打印图形的问题详解

c++如何打印由这样的字符组成的图形?
stststststststststsrn ststststststststsrn stststststststsrn ststststststsrn stststststsrn ststststsrn stststs rn ststsrn stsrn s

C语言 打印图案

C语言:打印图案*********

c程序打印图案

C语言的程序是由什么组成

c语言统计每个字符出现的次数
#include&amp;lt;stdio.h&amp;gt; #include&amp;lt;string.h&amp;gt; void main() { char str[20]; int i,num[256]={0}; printf(&quot;please input string:&quot;); scanf(&quot;%s&quot;,str); for(i=0;i&amp;lt;strlen(str);i++) ...

c语言打印*图程序

100行Ｃ代码实现字符打印汉诺塔
#include <stdio.h>/*-------------------------------------------\ | 仅供于实现功能，看情况自己再添加延时函数等实现动画效果 | \-------------------------------------------*//*定义每个柱子的数据结构-->数组*/ int zhuzi_a[]={0,0,0,0,0,0,0,0,0,0};
BASE64转码后生成得字符串由那些字符组成?
rnrn
C语言根据分隔符提取字符

（C语言）打印星号图案

（c语言）打印星号图案

C语言 实现读取文件，并统计每个字符出现的个数
/***************** 实现读取文件，并统计每个字符出现的个数 *****************/ #include &lt;stdio.h&gt; #include &lt;stdlib.h&gt; unsigned long file_size; unsigned int frequency_count[512]; FILE* infilepointer; void...

Codes are far away from bugs with the animal protecting
lcd1602字符液晶C程序和仿真图
lcd1602字符液晶C程序和仿真图,lcd1602字符液晶C程序和仿真图

C语言字符界面
C语言的各种字符,适用于C语言课程设计时需要用到命令行的同学

C语言-字符
C语言学习资料，适合于学习C语言的初学者，以及学习不够深入的同学。
【C语言】字符的旋转

C语言 字符与字符串
getchar ():能从键盘读入一个字符，并且作为返回值返回。但是返回值汇编自动强制转化成整型（int）。用户可以用这个返回值与EOF（END OF FILE,文件结束标志，整型的）比较。比如 c=getchar（）；使用printf(&quot;%c&quot;,c);可以打印输入值。if((c=getchar())==EOF);fgets(buf,max,fin)；他的三个参数分别为，字符数组buf[max],...