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

int main(){
	char a[8][8];
	while(cin){
		for(int i=0;i<8;i++){
			for(int j=0;j<8;j++) a[i][j] = '0';
			for(int j=0;j<8;j++) cin >> a[i][j];
		}
		int x = 0;
		int y = 0;
		int z = 0;
		for(int i=0;i<8;i++){
			for(int j=0;j<8;j++){
				if(a[i][j]=='1'){
					if(j<7 and a[i][j+1]=='1') x++;
					if(i<7 and a[i+1][j]=='1') y++;
					if(i<7 and j<7 and a[i+1][j+1]=='1') z++;
				}
			}
		}
		if     (x==3 and y==0 and z==0) cout << "C" << endl;
		else if(x==0 and y==3 and z==0) cout << "B" << endl;
		else if(x==2 and y==2 and z==1) cout << "A" << endl;
		else if(x==1 and y==2 and z==0) cout << "D" << endl;
		else if(x==2 and y==1 and z==0) cout << "G" << endl;
		else if(x==2 and y==1 and z==2) cout << "E" << endl;
		else if(x==1 and y==2 and z==2) cout << "F" << endl;
	}
}