import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;
class APCS1{
public static void main(String arg[]) throws Exception {
try {
Scanner cin=new Scanner(System.in);
int comin;
while(cin.hasNext()) {
int cir=0;int i=0;
cir=cin.nextInt();
String output="";
while(cir>0) {
BufferedReader Bcin=new BufferedReader(new InputStreamReader(System.in));
String input=Bcin.readLine();
String[] arr= {"A","B","C","D","E","F"};
String arrcod[]= {"0 1 0 1","0 1 1 1","0 0 1 0","1 1 0 1","1 0 0 0","1 1 0 0"};
for(i=0;i<=5;i++) {
comin=input.compareTo(arrcod[i]);
if(comin==0) {
output+=arr[i];
}
}
cir--;
}
System.out.println(output);
}
}
catch(Exception e) {
e.printStackTrace();
}
}
}
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;
class APCS1{
public static void main(String arg[]) throws Exception {
try {
Scanner cin=new Scanner(System.in);
int comin;
while(cin.hasNext()) {
int cir=0;int i=0;
cir=cin.nextInt();
String output="";
while(cir>0) {
BufferedReader Bcin=new BufferedReader(new InputStreamReader(System.in));
String input=Bcin.readLine();
String[] arr= {"A","B","C","D","E","F"};
String arrcod[]= {"0 1 0 1","0 1 1 1","0 0 1 0","1 1 0 1","1 0 0 0","1 1 0 0"};
for(i=0;i<=5;i++) {
comin=input.compareTo(arrcod[i]);
if(comin==0) {
output+=arr[i];
}
}
cir--;
}
System.out.println(output);
}
}
catch(Exception e) {
e.printStackTrace();
}
}
}
為啥要宣告兩個BufferedReader