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: Wrong Answer

Solution code:
n = int(input())

if n < 999:
	print('ABC')
else:
	print('ABD')

Submission status: Wrong Answer

Solution code:
# vim: set fileencoding=utf-8:


def main():
    N = input()
    if N > 999:
        N += 1
        ans = "ABD" + str(N)[1:]
    else:
        k = N
        ans = ""
        for i in xrange(3 - len(str(k))):
            ans += "0"

        ans = "ABC" + ans + str(k)

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
# vim: set fileencoding=utf-8:


def main():
    N = input()
    if N > 999:
        k = N - 999
        print(k)
        ans = ""
        for i in xrange(3 - len(str(k))):
            ans += "0"

        ans = "ABD" + ans + str(k)
    else:
        k = N
        ans = ""
        for i in xrange(3 - len(str(k))):
            ans += "0"

        ans = "ABC" + ans + str(k)

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
n=eval('-'+input().replace(' ','+'))
s=0
for i in range(n):
  s+=i
print(s)

Submission status: Wrong Answer

Solution code:
print ('AB'+'C' if int (input ())<1000 else 'D')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
num = input('>> ')
num = int(num)
if num <= 999 and num >= 0 :
    print('ABC')
elif num >= 1000 and num <= 1998 :
    print('ABD')
else:
    print('条件が違います')

Submission status: Wrong Answer

Solution code:
num = input('>> ')
num = int(num)
if num <= 999 and num >= 0 :
    print('abc')
elif num >= 1000 and num <= 1998 :
    print('abd')
else:
    print('条件が違います')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
if n <= 999:
  print("ABC")
else:
  print("ADC")

Submission status: Wrong Answer

Solution code:
N = int(input())
if N < 999:
    print("ABC")
elif N <= 1998:
    print("ABD")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
if (N <= 999):
  if (N <= 9):
    print('ABC00'+str(N))
  elif (10 <= N <= 99):
    print('ABC0'+str(N))
  else:
    print('ABC'+str(N))
else:
  if (N-999 <= 9):
    print('ABD00'+str(N-999))
  elif(10 <= N-999 <= 99):
    print('ABD0'+str(N-999))
  else:
    print('ABD'+str(N-999))

Submission status: Wrong Answer

Solution code:
print("AB"+["c","D"][len(input())>3])

Submission status: Wrong Answer

Solution code:
n = int(input())
a = []
for i in [6,9]:
    j = 1
    while i**j<100000:
        a.append(i**j)
        j += 1
a.sort()
dp = [i for i in range(n+1)]
dp[0]= 0
for c in a:
    for i in range(c+1,n+1):
        dp[i] = min(dp[i-c]+1, dp[i])
print(dp[n])

Submission status: Wrong Answer

Solution code:
n = str(input())
print('ABC'+n) if int(n) < 1000 else print('ABD'+str(int(n)+1)[1:])

Submission status: Wrong Answer

Solution code:
print(["ABD","ABC"][int(input())>999])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

n = int(input())

if n < 1000:
  print("ABC%03d" % n)
else:
  print("ABD%03d" % (n-1000))

Submission status: Wrong Answer

Solution code:
N = int(input())
if N % 999 != 0:
    print("ABD")
else:
    print("ABC")

Submission status: Wrong Answer

Solution code:
N=int(input())
if N<1000:
    print('ABC%03d'%(N))
else:
    N=N-999
    print('ABD%03d'%(N))

Submission status: Wrong Answer

Solution code:

Submission status: Wrong Answer

Solution code:
N = int(input())

if N > 1000:
  print("ABD")
else:
  print("ABC")

Submission status: Wrong Answer

Solution code:
N = int(input())

if N <= 999:
  print('ABC{:03}'.format(N))
else:
  print('ABD{:03}'.format(N-999))

Submission status: Wrong Answer

Solution code:
N = int(input())

if N <= 999:
  print('ABC{}'.format(N))
else:
  print('ABD{}'.format(N-999))

Submission status: Wrong Answer

Solution code:
n = int(input())

if n / 1000 == 0:
	print("ABC")
else: 
	print("ABD")

Submission status: Wrong Answer

Solution code:
x=int(input())

if x <= 999:
	print("ABC")
else:
	print("ADB")

Submission status: Wrong Answer

Solution code:
n = int(input())
print("%03d" % (n%1000 + n//1000))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#encoding utf-8


n = int(input())

if n >= 999:
    print("ABD")

else:
    print("ABC")

Submission status: Wrong Answer

Solution code:
N = int(input())
if N < 1000:
	print('ABC%03d' % N)
else:
	print('ABD%03d' %(N-999))

Submission status: Wrong Answer

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

def main():
    #入力
    N = int(input())

    if N < 1000:
        print('ABC{0:03d}'.format(N))
    else:
        print('ABD{0:03d}'.format(N-999))


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
# coding: utf-8

N = int(input())
if N > 999:
    print('ABC')
elif N <= 999:
    print('ABD')

Submission status: Wrong Answer

Solution code:
def hello(a,b):
    c = b - a
    alen = 0
    for ccc in range(0,c):
        alen = alen + ccc  
    ans = alen - a
    print(ans)

Submission status: Wrong Answer

Solution code:
def B1(N):
    if N <= 999:
        return "ABC"
    elif N > 999:
        return "ABD"

Submission status: Wrong Answer

Solution code:
print("ABD" if int(input()) > 1000 else "ABC")

Submission status: Wrong Answer

Solution code:
N = int(input())
a = [1,]
b = []
i = 6
while i < N:
    b.append(i)
    i *= 6
c = []
i = 9
while i < N:
    c.append(i)
    i *= 9
L = sorted(a + b + c)
x = 0
i = 1
while N > 0:
    if N >= L[-i]:
        N -= L[-i]
        x += 1
    else:
        i += 1
print(x)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
if int(input())>1000:
    print('ABD')
else:
    print('ABC')

Submission status: Wrong Answer

Solution code:
a = int(input())
if a>1000:
    print('ABD')
else:
    print('ABC')

Submission status: Wrong Answer

Solution code:
n = int(input())
if n >= 1000:
    print('ABD' + ('00' + str(n-999))[-3:])
else:
    print('ABC' + ('00' + str(n))[-3:])

Submission status: Wrong Answer

Solution code:
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

n = ni()

dp = [99999999] * (n + 1)
dp[0] = 0
for i in range(1, n + 1):
    dp[i] = dp[i - 1] + 1
    k = 6
    while i - k >= 0:
        dp[i] = min(dp[i], dp[i - k] + 1)
        k *= 6
    k = 9
    while i - k >= 0:
        dp[i] = min(dp[i], dp[i - k] + 1)
        k *= 9
print(dp[n])

Submission status: Wrong Answer

Solution code:
N = int(input())

if N >= 1000:
    print("ABC")
else:
    print("ABD")

Submission status: Wrong Answer

Solution code:
n = int(input())
def con_n(n):
    if n <= 1000:
        return 'ABC'
    elif n > 1000:
        return 'ABD'
    
print(con_n(n))

Submission status: Wrong Answer

Solution code:
n = int(input())
def con_n(n):
    if n <= 1000:
        return 'ABC'
    elif n > 1000:
        return 'ABD'
    
con_n(n)

Submission status: Wrong Answer

Solution code:
n = int(input())
def con_n(n):
    if n <= 1000:
        return 'ABC'
    elif n > 1000:
        return 'ABD'

Submission status: Wrong Answer

Solution code:
n = int(input())
def con_n(n):
    if N <= 1000:
        return 'ABC'
    elif N > 1000:
        return 'ABD'

Submission status: Wrong Answer

Solution code:
def L(N):
    def cal(n: int, h: int):
        f = 0
        while True:
            f += 1
            m = n - pow(h, f)
            if m <= 0:
                break
            n = m
        return n, f - 1

    rem, count_1 = cal(N, 9)
    if rem == 0:
        return count_1
    rem, count_2 = cal(rem, 6)
    if rem == 0:
        return count_1 + count_2
    return count_1 + count_2 + rem

print(L(int(input())))

Submission status: Wrong Answer

Solution code:
def con_n(N):
    if N <= 1000:
        return 'ABC'
    elif N > 1000:
        return 'ABD'

Submission status: Wrong Answer

Solution code:
N = int(input())
#使い切ったブロックの数
block = (N-1) // 999

a = chr(ord( "C") + block)
N2 = N - block * 999

if N2 < 10:
 c = "00"
elif N2 < 100:
 c = "0"
else:
 c = ""
 

b = "AB" + a + c + str(N2)

print("{}".format(b))

Submission status: Wrong Answer

Solution code:
N = int(input())
#使い切ったブロックの数
block = (N-1) // 999

a = chr(ord( "C") + block)
N2 = N - block * 999

b = "AB" + a + str(N2)

print("{}".format(b))

Submission status: Wrong Answer

Solution code:
a = int(input())
if a < 1000:
    print('abc')
else:
    print('abd')

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

n = int(input())
if n < 1000:
    print("ABC" + str(n))
else:
    print("ABD" + str(n - 999))

Submission status: Wrong Answer

Solution code:
N = int(input())
if N <= 1000:
    print('ABC')
elif N > 1000:
    print('ABD')

Submission status: Wrong Answer

Solution code:
N = int(input())

if N < 100: print("ABC")
else: print("ABD")

Submission status: Wrong Answer

Solution code:
k=int(input())
if k<999:
    print("ABC")
else:
    print("ABD")

Submission status: Wrong Answer

Solution code:
N = int(input())
count = 0
ans = []
for i in range(N+1):
    count1 = 0
    count2 = 0
    N1 = N - i
    x = i
    for j in reversed(range(7)):
        while x >= 6**j:
            x -= 6**j
            count1 += 1
    for j in reversed(range(6)):
        while N1 >= 9**j:
            N1 -= 9**j
            count2 += 1
    count = count1 + count2
    ans.append(count)
print(min(ans))

Submission status: Wrong Answer

Solution code:
n  = int(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n_max = 100000

bs = [(6 ** i, 6) for i in range (1, 10)]
bs.extend([(9 ** i, 9) for i in range (1, 10)])
bs = list(sorted(filter(lambda x: x[0] <= n_max, bs)))
bms = []
s = 5
for b, i in bs:
    s += b * (i - 1)
    bms.append((b, i, s))

#print(bs)
#print(bms, len(bms))

#m = 44852
m = int(input())

stack = [(m, 0, len(bms) - 1)]
#print("search start!")
result = 10000
while stack:
    m, n, bms_i = stack.pop()
    b, i, s = bms[bms_i]
    #print(m, n, bms_i, b, i, s)

    if n > result:
#        print("skip!", m, n, bms_i)
        continue
    if bms_i < 0:
        if m < 6 and result > m + n:
            result = m + n
#            print('get result!', result)
        continue

    for j in range(0, i):
        next_m = m - b * j
        if next_m > 0 and n + j < result:
            stack.append((next_m, n + j, bms_i - 1))

print(result)