#include <iostream>
#include <cstdio>

using namespace std;

int main(void){
    int n,i=0,count=0;
    while (cin>>n) {
        if (n==1) count++;
        if(n==1 || 0<i){
            i++;
        }
        
        if(i==4&&count==4){
            cout<<"C"<<endl;
            i=0,count=0;
        }
        else if (i==10&&count==4){
            cout<<"A"<<endl;
            i=0,count=0;
        }
        else if (i==25&&count==4){
            cout<<"B"<<endl;
            i=0,count=0;
        }
        else if (i==16&&count==4){
            cout<<"D"<<endl;
            i=0,count=0;
        }
        else if (i==11&&count==4){
            cout<<"E"<<endl;
            i=0,count=0;
        }
        else if (i==18&&count==4){
            cout<<"F"<<endl;
            i=0,count=0;
        }
        else if (i==9&&count==4){
            cout<<"G"<<endl;
            i=0,count=0;
        }
    }
    
    return 0;
}