#include <iostream>
#include <stdio.h>
#include <string>
#include <math.h>
#include <algorithm>
#include <vector>
#include <map>
#include <cstdio>
#include <utility>

using namespace std;
typedef pair<double,double> P;




int main(){
	int field[8][8];
	string field1[8];
	
	for(int i = 0;i < 8;i++){
		getline(cin, field1[i]);
	}

	for(int i = 0;i < 8;i++){
		for(int j = 0;j < 8;j++){
			if(field1[i][j] == '1') field[i][j] = 1;
			else field[i][j] = 0;
		}
	}
	/*for(int i = 0;i < 8;i++){
		for(int j = 0;j < 8;j++){
			cout << field[i][j];
		}
		cout << endl;
	}
	cout << endl;*/
	for(int i = 0;i < 8;i++){
		int flag = 0;
		for(int j = 0;j < 8;j++){
			if(field[i][j] == 1){
				//cout << i << j <<endl;
				if(field[i][j] == field[i][j+1]){
					if(field[i][j] == field[i+1][j]){
						if(field[i][j] == field[i+1][j+1]){
							cout << "A" << endl;
							flag = 1;break;
						}
						else if(field[i][j] == field[i+1][j-1]){
							cout << "G" << endl;
							flag = 1;break;
						}
					}
					else if(field[i][j] == field[i][j+2] && field[i][j] == field[i][j+3]){
						cout << "C" << endl;
						flag = 1;break;
					}
					else if(field[i][j] == field[i+1][j+1] && field[i][j] == field[i+1][j+2]){
						cout << "E" << endl;
						flag = 1;break;
					}
				}
				else if(field[i][j] == field[i+1][j]){
					if(field[i][j] == field[i+1][j-1] && field[i][j] == field[i+2][j-1]){
						cout << "D" << endl;
						flag = 1;break;
					}
					else if(field[i][j] == field[i+1][j+1] && field[i][j] == field[i+2][j+1]){
						cout << "F" << endl;
						flag = 1;break;
					}
				}
				else if(field[i][j] == field[i+1][j] && field[i][j] == field[i+2][j] && field[i][j] == field[i+3][j]){
					cout << "B" << endl;
					flag = 1;break;
				}
			}
		}
		if(flag == 1) break;
	}

	return 0;
}