
#include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#define ll long long int
#define ld long double
#define INF 1000000000
#define EPS 0.0000000001
#define rep(i,n) for(i=0;i<n;i++)
using namespace std;
typedef pair<int, int> P;


int main()
{
  int s[20][20]={};
  int i,j;
  char a;

  do{
  int si=0,sj=0;
  bool c=true;
    for(i=5;i<13;i++)
      for(j=5;j<13;j++){
	scanf("\n%c",&a);
	s[i][j]=a-'0';
	if(s[i][j] && c){
	  c=false;
	  si=i;
	  sj=j;
	}
      }

    if(s[si][sj+1]){//a,c,e,g
      if(s[si+1][sj]){//a,g
	if(s[si+1][sj+1])
	  cout<<"A"<<endl;
	else
	  cout<<"G"<<endl;
      }else{//c.e
	if(s[si][sj+2])
	  cout<<"C"<<endl;
	else
	  cout<<"E"<<endl;
      }
    }else{//b,d,f
      if(s[si+2][sj])
	cout<<"B"<<endl;
      else if(s[si+1][sj-1])
	cout<<"D"<<endl;
      else
	cout<<"F"<<endl;
    }

  }while(scanf("%c",&a)!=EOF);

}