n = int(eval(input()))



if n <= 999:

    print("ABC")

else:

    print("ABD")

n = int(eval(input()))



if n < 1000:

    ans = "ABC"

else:

    ans = "ABD"

print(ans)

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

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

-if n <= 999: -    print("ABC") +if n < 1000: +    ans = "ABC" -    print("ABD") +    ans = "ABD" +print(ans)