#include <iostream>
#include <cmath>
#include <vector>
#include <algorithm>
using namespace std;

void solve(vector<vector<char> > a){
	for(int i = 0; i < 6; i++){
		for(int j = 0; j < 6; j++){
			if(a[i][j] == '1' && a[i + 1][j] == '1' && a[i][j + 1] == '1' && a[i + 1][j + 1] == '1'){
				cout << "A" << endl;
				return;
			}else if(a[i][j] == '1' && a[i + 1][j] == '1' && a[i + 2][j] == '1'){
				cout << "B" << endl;
				return;
			}else if(j > 0 && i > 0){
				if(a[i][j] == '1' && a[i - 1][j - 1] == '1' && a[i + 1][j] == '1' && a[i + 2][j + 1] == '1'){
					cout << "D" << endl;
					return;
				}else if(a[i][j] == '1' && a[i][j - 1] == '1' && a[i + 1][j] == '1' && a[i + 1][j + 1] == '1'){
					cout << "E" << endl;
					return;
				}else if(a[i][j] == '1' && a[i + 1][j] == '1' && a[i + 1][j + 1] == '1' && a[i + 2][j + 1] == '1'){
					cout << "F" << endl;
					return;
				}else if(a[i][j] == '1' && a[i][j + 1] == '1' && a[i + 1][j - 1] == '1' && a[i + 1][j] == '1'){
					cout << "G" << endl;
					return;
				}
			}
		}
	}
	cout << "C" << endl;
}

int main(){
	vector<vector<char> > a(8, vector<char>(8));
	for(int i = 0; i < 8; i++){
		for(int j = 0; j < 8; j++){
			cin >> a[i][j];
		}
	}
	solve(a);
}