n = int(eval(input()))

if n < 1000:

    print("ABC")

else:

    print("ABD")

n = int(eval(input()))

print(("ABC" if n<1000 else "ABD"))

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

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

-if n < 1000: -    print("ABC") -else: -    print("ABD") +print(("ABC" if n < 1000 else "ABD"))