n = int(eval(input()))

if n <= 999:

    print('ABC')

else:

    print('ABD')

n = int(eval(input()))

if n >= 1000:

    print('ABD')

else:

    print('ABC')

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

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

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