using System;
using System.Collections;
using System.Collections.Generic;

public class Hello{
    public static void Main(){
        var datasets = new List<Dataset>();
        int datasets_linecount = 0;
        int ansCount = 0;
        Dataset dset = new Dataset();
        foreach(string str in getLines()){
            if(str == ""){
                datasets_linecount=0;
                datasets.Add(dset);
                dset = new Dataset();
            }else{
                int[] intArray = strToIntArray(str);
                for(int i=0;i<intArray.Length;i++){
                    dset.values[datasets_linecount,i] = intArray[i]; 
                }
                datasets_linecount++;
            }
        }
        datasets.Add(dset);
        
        foreach(Dataset dataset in datasets){
            ansCount++;
            if(ansCount>=50) break;
            string str = scanEdge(dataset);
            if(str!="none") System.Console.WriteLine(str);
        }
        //System.Console.WriteLine("test");
    }
    //複数行の入力を、List<string>として取得。
    public static List<string> getLines(){
        var strings = new List<string>();
        while (true){
            var line = System.Console.ReadLine();
            if (line == null) break;
            strings.Add(line);
        }
        return strings;
    }
    //文字列を数字の配列へ
    public static int[] strToIntArray(string str){
        int[] intArray = new int[str.Length];
        for (int i = 0; i < str.Length; i++){
            intArray[i] = int.Parse(str[i].ToString());
        }
        return intArray;
    }
    //Datasetを受け取って、テトリスミノの形状を判断、文字列を返す。
    public static string scanEdge(Dataset dataset){
        for(int y=0;y<8;y++){
            for(int x=0;x<8;x++){
                //もしブロックがあれば形状を調べる。
                if(dataset.getValue(x,y) == 1){
                    return scanEdge_judge(dataset,x,y);
                }
            }
        }
        return "none";
    }
    //Datasetと座標を受け取って、該当するテトリスミノがあるか調べる
    public static string scanEdge_judge(Dataset dataset,int x,int y){
        if(dataset.getValue(x+1,y) == 1 && dataset.getValue(x,y+1) == 1 && dataset.getValue(x+1,y+1) == 1) return "A";
        if(dataset.getValue(x,y+1) == 1 && dataset.getValue(x,y+2) == 1 && dataset.getValue(x,y+3) == 1) return "B";
        if(dataset.getValue(x+1,y) == 1 && dataset.getValue(x+2,y) == 1 && dataset.getValue(x+3,y) == 1) return "C";
        if(dataset.getValue(x,y+1) == 1 && dataset.getValue(x-1,y+1) == 1 && dataset.getValue(x-1,y+2) == 1) return "D";
        if(dataset.getValue(x+1,y) == 1 && dataset.getValue(x+1,y+1) == 1 && dataset.getValue(x+2,y+1) == 1) return "E";
        if(dataset.getValue(x,y+1) == 1 && dataset.getValue(x+1,y+1) == 1 && dataset.getValue(x+1,y+2) == 1) return "F";
        if(dataset.getValue(x+1,y) == 1 && dataset.getValue(x,y+1) == 1 && dataset.getValue(x-1,y+1) == 1) return "G";
        return "none";
    }
}
//データセットのclass
public class Dataset{
    public int[,] values;
    public Dataset(){
        values = new int[,] {{0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0}};
    }
    public int getValue(int x,int y){
        if(x<0||x>=8||y<0||y>=8){
            return 0;
        }else{
            return values[y,x];
        }
    }
}




Measured memory_bytes: 9144