process.stdin.resume();
process.stdin.setEncoding('utf8');


var _HEIGHT = 8;
var input_string = '';

process.stdin.on('data', function(chunk) {
    input_string += chunk.toString();
});
 
process.stdin.on('end', function() {
    var lines = input_string.split('\n');
    var len = lines.length;
    var matrix = []
    for (var i = 0; i < len; i++) {
        var tmpLine = lines[i];
        if (tmpLine !== '') {
            matrix.push(tmpLine);
        }
        
        if (matrix.length === _HEIGHT) {
          judge(matrix);
          matrix = [];
        }
    }
});

function judge(ary) {
    tmpAry = [];
    for (var i = 0; i < _HEIGHT; i++) {
        if (ary[i].indexOf('1') > 0) {
            tmpAry.push(ary[i]);
        }
    }
    compShape(tmpAry);
}

function compShape(ary) {
    switch (ary.length) {
        case 1:
            console.log('C')
            break;
        case 2:
            case2(ary);
            break;
        case 3:
            case3(ary);
            break;
        case 4:
            console.log('B')
            break;
        default:
            console.log('Error');
    }
}

function case2(ary) {
    ind0 = ary[0].indexOf('1');
    ind1 = ary[1].indexOf('1');
    
    if (ind0 < ind1) {
        console.log('E');
    }
    else if (ind0 > ind1) {
        console.log('G');
    }
    else {
        console.log('A');
    }
}

function case3(ary) {
    ind0 = ary[0].indexOf('1');
    ind1 = ary[1].indexOf('1');
    if (ind0 < ind1) {
        console.log('F');
    }
    else {
        console.log('D');
    }
}
