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.



Sample input:
999


Sample output:
ABC

Submission status: Runtime Error

Solution code:
N,C = list(map(int,input().split()))
D = [ list(map(int,input().split()))  for i in range(C)]
c = [ list(map(int,input().split()))  for i in range(N)]

sep = {0:[0 for i in range(C)],1:[0 for i in range(C)],2:[0 for i in range(C)]}
for i,cx in enumerate(c):
    for j,cy in enumerate(cx):
        if len(c) == 2 and (i + j) % 3 == 2:
            sep[(i + j) % 3 - 1][cy -1] += 1
        else:
            sep[(i + j) % 3][cy - 1] += 1
minimums = [[],[],[]]
for key,values in sep.items():
    for i in range(C):
        m0 = 0
        am0 = 0
        m1 = 0
        am1 = 1
        deposit = 0
        for j,value in enumerate(values):
            deposit += D[j][i] * valuea
        sep[key].append(deposit)
min0 = min(sep[0])
min1 = min(sep[1])
min2 = min(sep[2])

print(min1 + min2 + min0)

Submission status: Runtime Error

Solution code:

a=input()
a=int(a)
b=input()
b=int(b)


sum=0
for x in range(b-a+1):
    sum+=x
    
high=sum-b

print(high)

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

typedef long long LL;
const LL mod=1000000007;
#define MAX 10000
#define NIL -1
const double PI  = acos(-1.0);
const int INF = 1e9 + 7;
//-------------------------------------------

int n;

int main(){

    cin.tie(0);
    ios::sync_with_stdio(false);

    cin >> n;

    if( n > 999)cout <<"ABD"<< endl;
    else { cout <<"ABC"<< endl;}

    return 0;
}

Submission status: Runtime Error

Solution code:
a, b = input().split(' ')

c = int(b) - int(a)

print(int(a) - (c - 1))

Submission status: Runtime Error

Solution code:
inf = 1000*500*500
D = []
c = []
d = {}
N,C = map(int,input().split())
for i in range(C):
    D.append(list(map(int,input().split())))
for i in range(N):
    c.append(list(map(int,input().split())))

for C1 in range(C):
    for C2 in range(C):
        for C3 in range(C):
            if C1 != C2 and C2 != C3 and C3 != C1:
                d[(C1+1,C2+1,C3+1)]=0
            else:
                d[C1+1,C2+1,C3+1]=inf

for i in range(N):
    for j in range(N):
        for C1 in range(C):
            for C2 in range(C):
                for C3 in range(C):
                    if (i+j)%3==0:
                        d[(C1+1,C2+1,C3+1)]+=D[c[i][j]-1][C1]
                    elif (i+j)%3==1:
                        d[(C1+1,C2+1,C3+1)]+=D[c[i][j]-1][C2]
                    else:
                        d[(C1+1,C2+1,C3+1)]+=D[c[i][j]-1][C3]

l = []
for x in d:
    l.append(d[x])
print(min(l))

Submission status: Runtime Error

Solution code:
N = int(input())
if (N < 1000):
    str(N)
    print("ABC" + N)
else:
    A = N - 999
    str(A)
    print("ABD" + A)

Submission status: Runtime Error

Solution code:
a = int(input())

if any(a):
  return a

if a >999
	return 'ABD'

elif a <999
	return 'ABC'

Submission status: Runtime Error

Solution code:
N=input()
num=int(N[3:])

if num>999:
    print("ABD")
else:
    print("ABC")

Submission status: Runtime Error

Solution code:
N, C = map(int, input().split())
D = [list(map(int, input().split())) for i in range(C)]
line1 = [0]*C
line2 = [0]*C
line0 = [0]*C
for i in range(N):
  c = list(map(int, input().split()))
  for j in range(N):
    if (i+j)%3 == 0:
      line0[c[j]-1] +=+1
    if (i+j)%3 == 1:
      line1[c[j]-1] +=+1
    if (i+j)%3 == 2:
      line2[c[j]-1] +=+1
ans = float("inf")
#line0をi+1に、1をj+1に, 2をk+1にそろえよう
#print(line0,line1,line2)
for i in range(C):
  for j in range(C):
    if j !=i :
      for k in range(C):
        if k !=i and k!=j: 
#          print(i,j,k)
          curr = 0
          for l in range(C):
            curr += line0[l]*D[l][i]
            curr += line1[l]*D[l][j]
            curr += line2[l]*D[l][k]
#          print(curr)
          ans = min(ans, curr)
print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
if (N < 1000):
    print("ABC" + N)
else:
    A = N - 999
    print("ABD" + A)

Submission status: Runtime Error

Solution code:
a,b = [int(i) for i in input().split(' ')]
n=b-a#13-8=5
N=n-1#5-1=4
x=(1/2*N)*(N+1)#2*5=10
y= x - a#10-8=2
print(int(y))

Submission status: Runtime Error

Solution code:
n = int(input())

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

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*
a_b = input().split()
a = int(a_b[0])
b = int(a_b[1])
n = b - a

h = (n - 1) * n / 2 - a

print(int(h))

Submission status: Runtime Error

Solution code:
#coding : utf-8

if __name__ == '__main__':

    N = int(input())
    if n < 1000:
        print('ABC')
    else:
        print('ABD')

Submission status: Runtime Error

Solution code:
N = int(input())

if N < 1000:
    print('ABC'+str(N)
else:
    print('ABD'+str(N-1000))

Submission status: Runtime Error

Solution code:
A, B = input().split()
a = int(A)
ans = 0

for i in range(a - 1):
    ans += i

print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
if (N < 1000):
    input("ABC" + N)
else:
    A = N - 999
    input("ABD" + A)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
n = int(input())

if n < 1000:
    print(ABC)
else:
    print(ABD)

Submission status: Runtime Error

Solution code:
import numpy as np
a, b = input().split(" ")
a = int(a)
b = int(b)

c = b - a
s = sum(list(np.arange(c)))
print(s - a)

Submission status: Runtime Error

Solution code:
N = input()
if N < 1000:
    print("ABC")
else:
    print("ABD")

Submission status: Runtime Error

Solution code:
N = int(input())

if (N>999): print("ABD")
else; print("ABC")

Submission status: Runtime Error

Solution code:
suuzi = int(input())

if a < 1000:
    print("ABC")
else:
    print("ABD")

Submission status: Runtime Error

Solution code:
N = input();
if(N < 1000):
    print("ABC");
else:
    print("ABD");

Submission status: Runtime Error

Solution code:
suuzi = input(u">")
 
if suuzi <= 999:
	print u"ABC"
elif suuzi >= 1000:
	print u"ABD"

Submission status: Runtime Error

Solution code:
# -*- coding:utf-8 -*-
 
suuzi = input(">>>")
 
if suuzi <= 999:
	print u"ABC"
elif suuzi >= 1000:
	print u"ABD"

Submission status: Runtime Error

Solution code:
N = input();
A = N / 1000;
N += A;
print(N);

Submission status: Runtime Error

Solution code:
N=int(input())

if N<1000:
    print(“ABC”)
else:
    print(“ABD”)

Submission status: Runtime Error

Solution code:
a = int(input())
if a>=999:
    print("ABD")
 else:
    print("ABC")

Submission status: Runtime Error

Solution code:
# -*- coding:utf-8 -*-

int = input(">>>")

if int <= 999:
    print u"ABC"
elif int >= 1000:
    printu"ABD"

Submission status: Runtime Error

Solution code:
a, b = map(int, input().split())
dif = b - a
sum = int(dif / 2 * (1 + dif))
print(sum - b)

Submission status: Runtime Error

Solution code:
a,b = [int(i) for i in input().split()]

step = 2
towers = [1]
i = 1
while True:
    towers.append(towers[i-1] + step)
    
    if towers[i] >= 499500:
        break
    i += 1
    step += 1


depth = towers[(b-a)-1] - b
print(depth)

Submission status: Runtime Error

Solution code:
n=int(input())
if n<=999:
  print('ABC'+'{0:03d}'.format(n))
else:
  n=n-999
  print('ABD'+{0:03d}'.format(n))

Submission status: Runtime Error

Solution code:
def summation(n):
    if n == 0:
        return 0
    elif n == 1:
        return 1
    else:
        return n + summation(n-1)


def main():
    a,b = map(int, input().split())
    
    n_plus1 = b-a
    
    ans = summation(n_plus1) - b
    
    print(ans)

    
if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
x = list(map(int,input().split( )))
z = x[1]-x[0]
t = 0
for s in range(z+2):
    t += s
    
print(t-x[1])

Submission status: Runtime Error

Solution code:
N = input()
if N < 1000:
    print("ABC")
else:
    print("ABD")

Submission status: Runtime Error

Solution code:
N = int(input())
if N < 1000:
    input("ABC" + N)
else:
    A = N - 999
    input("ABD" + A)

Submission status: Runtime Error

Solution code:
N = int(input())
if N < 1000:
    input("ABC" + N)
else:
    A = N - 999
    input("ABD" + N)

Submission status: Runtime Error

Solution code:
# https://beta.atcoder.jp/contests/abc099/tasks/abc099_a
# A - ABD

# A_ABD.py

N = int(input())

C_or_D = (N-1) // 999


name = ""

if C_or_D == 0:
    name += "ABC"
    #n = N
elif C_or_D == 1:
    name += "ABD"
    #n = '{0:03d}'.format(N - 999)

name += str(n)

print(name)

Submission status: Runtime Error

Solution code:
import sys

a, b = tuple([int(x)for x in sys.stdin.readline().split()])
diff = max(a, b) - min(a, b)

c = 0
for i in range(1, 1000):
    if diff == i:
        print(c - a)
        break
    c += i

Submission status: Runtime Error

Solution code:
a, b = map(int, input().split())

c = b - a
y = 0
for i in range(c+1):
    y = y + i

print(y-b)

Submission status: Runtime Error

Solution code:
N = input()
if 1 <= N <= 999:
    print("ABC")
else:
    print("ABD")

Submission status: Runtime Error

Solution code:
N = int(input())

if N < 1000:
    print(f'ABC{N:03}')
else:
    print(f'ABD{N-999:03}')

Submission status: Runtime Error

Solution code:
N = input()
if N < 1000:
 print(N)
else:
 print(N %1000 + 1)

Submission status: Runtime Error

Solution code:
line = input()

num = int(line)

if line < 1000:
    print("ABC")
else:
    print("ABD")

Submission status: Runtime Error

Solution code:
N = int(input())            
if N > 999:                 
    print("ABD")            
else:                       
    pritn("ABC")

Submission status: Runtime Error

Solution code:
n = int(input())
s = n > 1000 if 'D' else 'C'
print('AB' + s + str(n % 1000))

Submission status: Runtime Error

Solution code:
n = int(input())

ans = 'ABC' if n <= 999: else 'ABD'

print(ans)

Submission status: Runtime Error

Solution code:
print('ABC' if int(intput()) < 1000 else 'ABD')

Submission status: Runtime Error

Solution code:
a=raw_input()
if a[0] == "1":
  print "ABD" + int(a[1:]+1-1000)
else:
  print "ABC" + a

Submission status: Runtime Error

Solution code:
n = int(input())
if(n <= 999):
    print('ABC' + n)
else:
    print('ABD' + n)