print(('AB'+'DC'[not input()[3:]]))

print(("AB"+"DC"[len(eval(input()))<4]))
print(("AB" + "DC"[not input()[3:]]))

print(("AB" + "DC"[len(eval(input())) < 4]))

-print(("AB" + "DC"[not input()[3:]])) +print(("AB" + "DC"[len(eval(input())) < 4]))