#include <iostream>
#include <string>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <cmath>
#include <stack>
#include <map>
#include <sstream>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
using namespace std;

int main(){
    int glid[8];
    while(cin >> glid[0]){
        for(int i=1; i<8; i++) cin >> glid[i];
        for(int i=0; i<8; i++){
            if(glid[i] != 0){
                if(glid[i+1]==glid[i] && glid[i]%11==0) cout << "A";
                else if(glid[i]==glid[i+1] && glid[i+1]==glid[i+2]) cout << "B";
                else if(glid[i]%1111==0) cout << "C";
                else if(glid[i+1]==glid[i]*10+glid[i]) cout << "D";
                else if(glid[i+1]==glid[i]/10) cout << "E";
                else if(glid[i+1]==glid[i]+glid[i]/10) cout << "F";
                else if(glid[i+1]==glid[i]*10) cout << "G";
                cout << endl;
                break;
            }
        }
    }
    return 0;
}
