#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <list>
#include <iterator>
#include <queue>
#include <stack>
#include <deque>
#include <sstream>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <complex>
#include <functional>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cassert>
#include <cstdlib>
#define REP(i,m,n) for(int i=m;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define rp(i,c) rep(i,(int)c.size())
#define fr(i,c) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)
#define mp make_pair
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define dbg(x) cerr<<#x<<" = "<<(x)<<endl
#define v_delete(a,b) (a).erase(remove((a).begin(), (a).end(), b), (a).end())

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pi;
const int inf=1<<28;
const double INF=1e10,EPS=1e-9;

template<class T>int SIZE(T a){return a.size();}
template<class T>string IntToString(T num){string res;stringstream ss;ss<<num;return ss.str();}
template<class T>T StringToInt(string str){T res=0;for(int i=0;i<SIZE(str);i++)res=(res*10+str[i]-'0');return res;}
template<class T>T gcd(T a,T b){if(b==0)return a;return gcd(b,a%b);}
template<class T>T lcm(T a,T b){return a/gcd(a,b)*b;}

int main(){
	while(true){
		int n[8][8];
		rep(i,8){
			rep(i2,8){
				char c;
				cin >> c;
				n[i][i2]= c - '0';
			}
		}
		bool flag=false;
		rep(i,8){
			rep(i2,8){
				if(n[i][i2]){
					if(n[i][i2] && n[i+1][i2] && n[i][i2+1] && n[i+1][i2+1])
						cout << "A" << endl;
					else if(n[i][i2] && n[i][i2+1] && n[i][i2+2] && n[i][i2+3])
						cout << "C" << endl;
					else if(n[i][i2] && n[i+1][i2] && n[i+2][i2] && n[i+3][i2])
						cout << "B" << endl;
					else if(n[i][i2] && n[i+1][i2] && n[i+1][i2-1] && n[i+2][i2-2])
						cout << "D" << endl;
					else if(n[i][i2] && n[i][i2+1] && n[i+1][i2+1] && n[i+1][i2+2])
						cout << "E" << endl;
					else if(n[i][i2] && n[i+1][i2] && n[i+1][i2+1] && n[i+2][i2+1])
						cout << "F" << endl;
					else if(n[i][i2] && n[i][i2+1] && n[i+1][i2] && n[i+2][i2-1])
						cout << "G" << endl;
					flag=true;
				}
				if(flag)
					break;
			}
			if(flag)
				break;
		}
		if(!flag){
			break;
		}
	}
}