n = int(eval(input()))

if n < 1000:

    print("ABC")

else:

    print("ABD")
n = int(eval(input()))

if n > 999:

    print("ABD")

else:

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

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

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