#include <cstdio>
using namespace std;

int pos[7][4] = {{0, 1, 10, 11}, {0, 10, 20, 30}, {0, 1, 2, 3},
{1, 10, 11, 20}, {0, 1, 11, 12}, {0, 10, 11, 21}, {1, 2, 10, 11}};
char s[110] = {0};

int main()
{
	int i, j, k;
	
	while( scanf("%s", s + 1) != -1 ){
		for( i = 1; i < 8; i++ )
			scanf("%s", s + 10 * i + 1);
		
		for( i = 0; i < 7; i++ ){
			for( j = 0; j < 100; j++ ){
				for( k = 0; k < 4; k++ ){
					if( pos[i][k] + j >= 110 || s[pos[i][k] + j] != '1' )
						break;
				}
				if( k == 4 )	//??????????????´????????¨??¨'1'?????£?????´???????????????
					break;
			}
			if( j < 100 )	//?????§???????????´???????????????
				break;
		}
		printf("%c\n", 'A' + i );
	}
	return 0;
}