#include <iostream>
#include <string>
using namespace std;

const double EPS = 1.0e-6;

int main()
{
	while(1){
		string all[8];
		bool endflg = false;
		for(int i=0; i<8; i++){
			if(!(cin>>all[i])) endflg = true;
			if(endflg) break;
		}
		if(endflg) break;

		for(int i=0; i<7; i++){
			bool breakflg = false;
			for(int j=0; j<7; j++){
				// ツ可。ツづ可個ゥツづゥ
				if(all[i][j]-'0'==1&&all[i][j+1]-'0'==1){
					if(all[i+1][j]-'0'==1&&all[i+1][j+1]-'0'==1){
						ans = "A";
					} else if(all[i+1][j]-'0'==0&&all[i+1][j+1]-'0'==0){
						ans = "C";
					} else if(all[i+1][j]-'0'==1&&all[i+1][j+1]-'0'==0){
						ans = "G";
					} else if(all[i+1][j]-'0'==0&&all[i+1][j+1]-'0'==1){
						ans = "E";
					}
					breakflg = true;
					break;
				}
				// ツ縦ツづ可個ゥツづゥ
				if(all[i][j]-'0'==1&&all[i+1][j]-'0'==1){
					if(all[i][j+1]-'0'==1&&all[i+1][j+1]-'0'==1){
						ans = "A";
					} else if(all[i][j+1]-'0'==0&&all[i+1][j+1]-'0'==0){
						ans = "B";
					} else if(all[i][j+1]-'0'==1&&all[i+1][j+1]-'0'==0){
						ans = "D";
					} else if(all[i][j+1]-'0'==0&&all[i+1][j+1]-'0'==1){
						ans = "F";
					}
					breakflg = true;
					break;
				}
			}
			if(breakflg) break;
		}
		cout<<ans<<endl;
	}
	return 0;
}