Problem:
Score : 100 points

Problem Statement

Decades have passed since the beginning of AtCoder Beginner Contest.

The contests are labeled as ABC001, ABC002, ... from the first round, but after the 999-th round ABC999, a problem occurred: how the future rounds should be labeled?

In the end, the labels for the rounds from the 1000-th to the 1998-th are decided: ABD001, ABD002, ..., ABD999.

You are given an integer N between 1 and 1998 (inclusive). Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.

Constraints

1 \leq N \leq 1998

N is an integer.

Input

Input is given from Standard Input in the following format:

N

Output

Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.

Sample Input 1

999

Sample Output 1

ABC

The 999-th round of AtCoder Beginner Contest is labeled as ABC999.

Sample Input 2

1000

Sample Output 2

ABD

The 1000-th round of AtCoder Beginner Contest is labeled as ABD001.

Sample Input 3

1481

Sample Output 3

ABD

The 1481-th round of AtCoder Beginner Contest is labeled as ABD482.

Solution in C (GCC 5.4.1) (judge verdict: Wrong Answer)

#include<stdio.h>
int main()
{
    int a,b,i,j,s=0,k=0,m;
    printf("Input is given from Standard Input in the following format:\n");
    scanf("%d",&a);
    int A=a;
    for(i=1; ; i++)
    {
        b=a%10;
        k++;
        a=a/10;
        if(k==1)s=b;
        if(k==2)m=b;
        if(k==3)j=b;
        if(k==3)break;
    }
    printf("Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.\n");
    if(A>999)
    {
        printf("ABD\n");
        printf("The %d-th round of AtCoder Beginner Contest is labeled as ABD%d%d%d.\n",A,j,m,s+1);

    }
    else
    {

        printf("ABC\n");
        printf("The %d-th round of AtCoder Beginner Contest is labeled as ABC%d%d%d.\n",A,j,m,s);
    }
    return 0;
}