for _ in range(3):
    num = sum(list(map(int, input().split())))
    if num == 0:
        print("D")
    elif num == 1:
        print("C")
    elif num == 2:
        print("B")
    elif num == 3:
        print("A")
    # elif num == 4:
    else:
        print("E")