#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 j=0;j<8;j++){
			bool b = false;
			for(int i=0;i<8;i++) if(a[i][j]=='1') b = true;
			if(b) x++;
		}
		for(int i=0;i<8;i++){
			bool b = false;
			for(int j=0;j<8;j++) if(a[i][j]=='1') b = true;
			if(b) y++;
		}
		for(int i=0;i<15;i++){
			bool b = false;
			for(int j=0;j<i;j++){
				if(i-j<8) if(a[j][i-j]=='1') b = true;
			}
			if(b) z++;
		}
		if(x==4) cout << "C" << endl;
		else if(y==4) cout << "B" << endl;
		else if(x*y==4) cout << "A" << endl;
		else if(x*z==4) cout << "D" << endl;
		else if(y*z==4) cout << "G" << endl;
		else if(x==3) cout << "E" << endl;
		else if(y==3) cout << "F" << endl;
	}
}