import std.stdio, std.algorithm, std.conv, std.array, std.string, std.math, std.typecons;

void main()
{
    auto N = readln.chomp.to!int;

    if (N <= 999) {
        writefln("ABC%03d", N);
    } else {
        N -= 999;
        writefln("ABD%03d", N);
    }
}