"use strict"
function Main(input) {
    if (!input.match(/([\n])/)){
        input = input.split(" ");
    } else {
        input = input.split("\n");
        for (var i = 0; i < input.length; i++){
            input[i] = input[i].split(" ");
        }
    }
    //中身↓
    let end = "D";
    if(input[0]<=999){
        end = "C";
    }
    console.log("AB"+end);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));