n=int(eval(input()))



if n<=999:

    print("ABC")

else:

    print("ABD")
if int(eval(input()))<=999:

    print("ABC")

else:

    print("ABD")
n = int(eval(input()))
if n <= 999:
    print("ABC")
else:
    print("ABD")

if int(eval(input())) <= 999:
    print("ABC")
else:
    print("ABD")

-n = int(eval(input())) -if n <= 999: +if int(eval(input())) <= 999: