N = int(eval(input()))



print((["ABC", "ABD"][N >= 10 ** 3]))
N = int(eval(input()))



if N <= 999:

    print("ABC")

else:

    print("ABD")
N = int(eval(input()))
print((["ABC", "ABD"][N >= 10**3]))

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

-print((["ABC", "ABD"][N >= 10**3])) +if N <= 999: +    print("ABC") +else: +    print("ABD")