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:
s = int(input())

if s > 999:
  print('ABD{:03d}'.format(s-999))
else:
  print('ABC{:03d}'.format(s))

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()
n = str(int(n) - 999)
ans = "ABD" + n.zfill(3)
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
print("ABD{}".format(n-999))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

if n % 999 == 0:
    print(999)
else:
    print(n%999)

Submission status: Wrong Answer

Solution code:
n=int(input())
import math
ansa=[0]
ansb=[0]
ans=[]
cnt=0
x=0
y=0
for i in range(1,n+1):
    while 9**(x+1)<=i:
        x+=1
    for j in range(x,-1,-1):
        z=(math.floor(i/(9**j))%9)
        i-=(9**j)*z
        cnt+=z
    ansa.append(cnt)
    cnt=0    
    
for i in range(1,n+1):
    while 6**(y+1)<=i:
        y+=1
    for j in range(y,-1,-1):
        z=(math.floor(i/(6**j))%6)
        i-=(6**j)*z
        cnt+=z
    ansb.append(cnt)
    cnt=0
    
for i in range(n+1):
    ans.append(ansa[i]+ansb[n-i])
    
print(min(ans))

Submission status: Wrong Answer

Solution code:
#n = int(input())
#n,k = map(int,input().split())
#x = list(map(int,input().split()))

n1 = input()
n = int(n1)+1

if n<=1000:
    print("ABC"+n1)
else:
    print("ABD"+str(n))

Submission status: Wrong Answer

Solution code:
n = int(input())
if n > 999:
    num = n-999
    print('ABD{:03}'.format(num))

else:
    print('ABC{:03}'.format(n))

Submission status: Wrong Answer

Solution code:
n=input()
if len(n)==4:
  print("ABD"+str(int(n)-999).zfill(3))
else:
  print("ABC"+n.zfill(3))

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())

if N<1000:
    print("ABC{:03d}".format(N))
elif N>=1000:
    print("ABD{:03d}".format(N-999))

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())
print("ABC" if n<999 else "ABD")

Submission status: Wrong Answer

Solution code:
n = int(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#99a
N = int(input())
if N >= 1100:
    ans = ["ABD",N-1000+1]
elif 1100 > N >= 1010:
    ans = ["ABD0",N-1000+1]
elif 1010 > N >= 1000:
    ans = ["ABD00",N-1000+1]
elif 1000 > N >= 100:
    ans = ["ABC",N]
elif 100 > N >= 10:
    ans = ["ABC0",N]
elif 10 > N >= 1:
    ans = ["ABC00",N]

print(''.join(map(str, ans)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

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

Submission status: Wrong Answer

Solution code:
print(format(0xABC000 + int(input(), 16), 'x').upper())

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# Strange Bank

N = int(input())
N_max = 100000

dp = ['inf']*2*N_max
for n in range(6):
	dp[n] = n

for n in range(6,N+1):
	cnd = [dp[n-1]+1]
	for i in range(1,7):
		if n > 6**i-1:
			cnd.append(dp[n-6**i]+1)
	for j in range(1,5):
		if n > 9**j-1:
			cnd.append(dp[n-9**j]+1)
	dp[n] = min(cnd)
	
print(dp[N])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
dp = list(range(N+1))

i = 6
while i <= N:
    for j in range(i, N+1):
        dp[j] = min(dp[j], 1+dp[j-i])
    i = i*6
i = 9
while i <= N:
    for j in range(N+1):
        dp[j] = min(dp[j], 1+dp[j-i])
    i = i*9
print(dp[N])

Submission status: Wrong Answer

Solution code:
N=int(input())
print("AB" + ("C" if N < 1000 else "D"), N % 1000)

Submission status: Wrong Answer

Solution code:
N = int(input())
if N >= 1000:
  print("ABD{:03}".format(N-999))
else:
  print("ABC{:03}".format(N))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys

input = sys.stdin.readline


def main():
    n = int(input())
    if n < 1000:
        print("ABC{:03}".format(n))
    else:
        print("ABD{:03}".format(n - 999))


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
N = int(input())
if N<1000:
    if len(str(N))==1:
        print("ABC"+"00"+str(N))
    elif len(str(N))==2:
        print("ABC"+"0"+str(N))
    elif len(str(N))==3:
        print("ABC"+str(N))
else:
    N = N-999
    if len(str(N))==1:
        print("ABD"+"00"+str(N))
    elif len(str(N))==2:
        print("ABD"+"0"+str(N))
    elif len(str(N))==3:
        print("ABD"+str(N))

Submission status: Wrong Answer

Solution code:
N = int(input())
INF = 10**6
dp = [INF] * (max(9, N)+1)
for i in range(9):
  if  0 < i < 6:
    dp[i] = i
  elif i < 9:
    dp[i] = i%6+1
for i in range(N):
  n = m = 1
  while i+9**n <= N:
    dp[i+9**n] = min(dp[i+9**n], dp[i] + 1)
    n += 1
  while i+6**m <= N:
    dp[i+6**m] = min(dp[i+6**m], dp[i] + 1)
    m += 1
print(dp[N])

Submission status: Wrong Answer

Solution code:
N = int(input())
INF = 10**6
dp = [INF] * (max(9, N)+1)
for i in range(10):
  if  0 < i < 6:
    dp[i] = i
  elif i < 9:
    dp[i] = i%6+1
  else:
    dp[i] = 1
for i in range(N):
  n = m = 1
  while i+9**n <= N:
    dp[i+9**n] = min(dp[i+9**n], dp[i] + 1)
    n += 1
  while i+6**m <= N:
    dp[i+6**m] = min(dp[i+6**m], dp[i] + 1)
    m += 1
print(dp[N])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x=int(input())
a=x//999
b=x%999+1000
B=str(b)
C=B[1:]
if a==0:
  print("ABC"+C)
else:
  print("ABD"+C)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())


def dfs(remain, count):
    if 6 > remain:
        return count + remain
    count9 = dfs(remain - 9, count + 1) if remain - 9 > 0 else count + remain
    count6 = dfs(remain - 6, count + 1) if remain - 6 > 0 else count + remain
    return count9 if count9 <= count6 else count6


count = 0
while n >= 6:
    m_9 = 1
    while 9 ** m_9 <= n:
        m_9 += 1
    m_6 = 1
    while 6 ** m_6 <= n:
        m_6 += 1
    if 2 == m_9 and 2 == m_6:
        count += dfs(n, 0)
        n = 0
    else:
        candidates = [9 ** (m_9 - 1), 6 ** (m_6 - 1)]
        n -= max(candidates)
        count += 1
print(count + n)

Submission status: Wrong Answer

Solution code:
n = int(input())


def dfs(remain, count):
    if 6 > remain:
        return count + remain
    count9 = dfs(remain - 9, count + 1) if remain - 9 >= 0 else count + remain
    count6 = dfs(remain - 6, count + 1) if remain - 6 >= 0 else count + remain
    return count9 if count9 < count6 else count6


count = 0
while n >= 6:
    m_9 = 1
    while 9 ** m_9 <= n:
        m_9 += 1
    m_6 = 1
    while 6 ** m_6 <= n:
        m_6 += 1
    if 2 == m_9 and 2 == m_6:
        count += dfs(n, 0)
        n = 0
    else:
        candidates = [9 ** (m_9 - 1), 6 ** (m_6 - 1)]
        n -= max(candidates)
        count += 1
print(count + n)

Submission status: Wrong Answer

Solution code:
N = int(input())
if N<1000:
  print('ABC' + str(N).zfill(3))
  exit()
print('ABD' + str(N-999).zfill(3))

Submission status: Wrong Answer

Solution code:
N = int(input())
if N<1000:
  print('ABC' + str(N).zfill(3))
  exit()
print('ABD' + str(N-999).zfill(3))

Submission status: Wrong Answer

Solution code:
N = int(input())

if N < 1000:
    print('ABC' + str(N).zfill(3))
else:
    print('ABD' + str(N - 999).zfill(3))

Submission status: Wrong Answer

Solution code:
n=int(input())
if n>1000:
  s=str(n-999)
  s="0"*(3-len(s))+s
  print("ABD"+s)
else:
  s=str(n)
  s="0"*(3-len(s))+s
  print("ABC"+s)

Submission status: Wrong Answer

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

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')

if N >= 1000:
    print('AGC')

Submission status: Wrong Answer

Solution code:
n= int(input())
if n > 999:
    print('ABD',str(n-999).zfill(3),sep='')
else:
    print('ABC',str(n).zfill(3),sep='')

Submission status: Wrong Answer

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

n = int(input())

pref = ""
if n <= 999:
    pref = "ABC"
else:
    pref = "ABD"
    n = n - 999

print(pref + str(n).zfill(3))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input());print(("ABD"if n//1000else"ABC")+str(n%1000+n//1000).zfill(3))

Submission status: Wrong Answer

Solution code:
N = int(input())
 
if N >= 1000:
  print("ABD"+str(N-1000).zfill(3))
else:
  print("ABC"+str(N).zfill(3))

Submission status: Wrong Answer

Solution code:
N = int(input())

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

Submission status: Wrong Answer

Solution code:
n = int(input())
low_numbers = [1]

max_9_p = 1
while 9 ** max_9_p <= n:
    low_numbers.append(9 ** max_9_p)
    max_9_p += 1

max_6_p = 1
while 6 ** max_6_p <= n:
    low_numbers.append(6 ** max_6_p)
    max_6_p += 1

low_numbers.sort(reverse=True)
ans_list = []

for i in range(len(low_numbers)):
    n_ = n
    ans = 0
    for m in low_numbers[i:]:
        c = n_ // m
        ans += c
        n_ %= m
    ans_list.append(ans)

print(min(ans_list))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

if n <= 999:
    print('ABC'+str(n).zfill(3))
else:
    print('ABD'+str(n+1).zfill(3))

Submission status: Wrong Answer

Solution code:
n = int(input())

if n <= 999:
    print('ABC'+str(n))
else:
    print('ABD'+str(n+1))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
if 1 <= n <= 999:
  print(n)
else:
  print(n-999)

Submission status: Wrong Answer

Solution code:
N=int(input())
a='ABD'
b='ABC'
c=str(N-999)
d=str(N)
if N<=999:
  print(b+d)
else:
  print(a+c)

Submission status: Wrong Answer

Solution code:
N=int(input())
a='ABD'
b='ABC'
c=str(N+1)
d=str(N)
if N<=999:
  print(b+d)
else:
  print(a+c)

Submission status: Wrong Answer

Solution code:
N=int(input())
a='ABD'
b=str(N+1)
print(a+b)

Submission status: Wrong Answer

Solution code:
n = int(input())
dp = [i for i in range(n+1)]

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

Submission status: Wrong Answer

Solution code:
print('AABBCD'[int(input())>1000::2])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=input()
if int(N)>=1000:
    n=int(N)-999
    N=str(n)
    name="ABD"
else:
    name="ABC"
print(name+N.zfill(3))

Submission status: Wrong Answer

Solution code:
N=int(input())
if N<=999:
    print("ABC",end="")
    print(N)
else:
    print("ABD",end="")
    print(N-999)

Submission status: Wrong Answer

Solution code:
from sys import stdin
N = int(stdin.readline().rstrip())
if N <= 999:
    print("ABC")
    
else:
    print("ARC")

Submission status: Wrong Answer

Solution code:
N = int(input())

if N <= 999:
    N = str(N)
    N = N.zfill(3)
    print("ABC{}".format(N))
else:
    N -= 999
    N = str(N)
    N = N.zfill(3)
    print("ABD{}".format(N))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#https://atcoder.jp/contests/abc099/tasks/abc099_a

a = int(input())

if a <= 99:
    print("ABC")
else:
    print("ABD")

Submission status: Wrong Answer

Solution code:
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{:03d}".format(N))
else:
    print("ABD{:03d}".format(N-999))

Submission status: Wrong Answer

Solution code:
n = int(input())

if n > 999:
    print('ABD{}'.format(str(n - 999).zfill(3)))
else:
    print('ABC{}'.format(n))

Submission status: Wrong Answer

Solution code:
n = int(input())

if n > 999:
    print('ABD{}'.format(n - 999))
else:
    print('ABC{}'.format(n))

Submission status: Wrong Answer

Solution code:
print('AB%s'%chr(67+len(input())%3))

Submission status: Wrong Answer

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

# input
N = int(input())

# solve
ans = 'ABC' + str(N).zfill(3) if N < 1000 else 'ABD' + str(N - 999).zfill(3)

# output
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

if N <= 999:
  print("ABC"+str(N))
else:
  print("ABD"+str(N-999))

Submission status: Wrong Answer

Solution code:
N=int(input())

if N <= 999:
  print("ABC"+str(N))
else:
  print("ABD"+str(N))

Submission status: Wrong Answer

Solution code:
N=int(input())

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

Submission status: Wrong Answer

Solution code:
n = int(input())
if n < 1000:
  print('ABC{0:0>3}'.format(n))
else:
  print('ABD{0:0>3}'.format(n-999))

Submission status: Wrong Answer

Solution code:
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")
else:
    print("ABD")

Submission status: Wrong Answer

Solution code:
N = int(input())
S = 'ABD' if N >= 1000 else 'ABC'
print(S+str(N%1000+N//1000))

Submission status: Wrong Answer

Solution code:
x=int(input())
if x<1000:
  print("ABC"+str(x))
else:print("ABD"+str(x-999).zfill(3))

Submission status: Wrong Answer

Solution code:
N = int(input())
offset = 'ABC' if N < 999 else 'ABD'
print(offset)# + str(N%999))

Submission status: Wrong Answer

Solution code:
N = int(input())
offset = 'ABC' if N < 999 else 'ABC'
print(offset + str(N%999))

Submission status: Wrong Answer

Solution code:
N = int(input())
offset = 'ABC' if N < 1000 else 'ABC'
print(offset + str(N%1000))

Submission status: Wrong Answer

Solution code:
a=int(input())

if a<=9:
  print("ABC00"+str(a))
elif 10<=a<=99:
  print("ABC0"+str(a))
elif 100<=a<=999:
  print("ABC"+str(a))
elif 1000<=a<=1008:
  print("ABD00"+str(a-999))
elif 1009<=a<=1098:
  print("ABD0"+str(a-999))
else:
  print("ABD"+str(a-999))

Submission status: Wrong Answer

Solution code:
a=int(input())
if a<=999:
  print("ABC"+str(a))
elif 1000<=a<=1008:
  print("ABD00"+str(a-999))
elif 1009<=a<=1098:
  print("ABD0"+str(a-999))
else:
  print("ABD"+str(a-999))

Submission status: Wrong Answer

Solution code:
a=int(input())
if a<=999:
  print("ABC"+str(a))
elif 1000<=a<=1008:
  print("ABC00"+str(a-999))
elif 1009<=a<=1098:
  print("ABC0"+str(a-999))
else:
  print("ABC"+str(a-999))

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = None
if n < 1000:
    ans = 'ABC{:>3}'.format(str(n))
else:
    ans = 'ABD{:>3}'.format(str(n + 1)[1:])
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
contest = ['ABC', 'ABD']
N = int(raw_input())
n = (N-1)%999+1
ans = str(n)
if n < 100: ans = '0'+ans
if n < 10: ans = '0'+ans
ans = contest[(N-1)/999]+ans
print ans

Submission status: Wrong Answer

Solution code:
contest = ['ABC', 'ABD']
N = int(raw_input())
print contest[(N-1)/999] + str((N-1)%999+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a = int(input())

if (a < 1000) :
    print("ABC"+"{0:03d}".format(a))
else :
    print("ABD"+"{0:03d}".format(a%1000 + 1))

Submission status: Wrong Answer

Solution code:
n = int(input())
print("ABC"+str(n) if n < 1000 else "ABD"+str(n-999).zfill(3))

Submission status: Wrong Answer

Solution code:
N = int(input())
under = "ABC"
over = "ABD"

if N > 1000:
#  tmp = str(N-1000)
  print(over)
else:
#  tmp = str(N)
  print(under)

Submission status: Wrong Answer

Solution code:
N = int(input())
under = "ABC"
over = "ABD"

if N > 1000:
  tmp = str(N-1000)
  print(over + tmp)
else:
  tmp = str(N)
  print(under + tmp)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys


def input():
    return sys.stdin.readline()[:-1]

# N = int(input())
# A = [int(x) for x in input().split()]
# a, b, c = map(int, input().split())
# name1 = str(input())
# alph = {"A": 1, "B": 2, "C": 3, "D": 4, "E": 5}
n = int(input())
if n>999:
    print("ABC")
else:
    print("ABD")

Submission status: Wrong Answer

Solution code:
N = int(input())
L1 = [1]
L2 = [6**i for i in range(1,10) if 6**i < 100000]
L3 = [9**i for i in range(1,10) if 9**i < 100000]
L = L1 + L2 + L3
L.sort(reverse = True)
def paypay(N):
        if N < 6:
                return N
        else:
                ans = 0
                while N > 0:
                      for i in L:
                            if N >= i:
                                  N = N - i
                                  ans += 1
                                  break
        return ans


print(min(paypay(N),paypay(N-6)+1,paypay(N-9)+1) if N > 6 else N)

Submission status: Wrong Answer

Solution code:
N=int(input())

if N<1000:
	N=list(str(N))
	if len(N)<3:
		while len(N)!=3:
			list(N)
			N.insert(0,"0")
	N=''.join(N)
	print('ABC'+N)
else:
	N=N-999
	N=list(str(N))
	if len(N)<3:
		while len(N)!=3:
			list(N)
			N.insert(0,"0")
	N=''.join(N)
	
	print('ABD'+str(N))

Submission status: Wrong Answer

Solution code:
N=int(input())

if N<1000:
	N=list(str(N))
	if len(N)<3:
		while len(N)==3:
			list(N)
			N.insert(0,0)
	N=''.join(N)
	print('ABC'+str(N))
else:
	N=N-999
	N=list(str(N))
	if len(N)<3:
		while len(N)==3:
			list(N)
			N.insert(0,0)
	N=''.join(N)
	print('ABD'+str(N))

Submission status: Wrong Answer

Solution code:
n=int(input())
print("AB"+("C" if n<1000 else "D")+str(n%1000).zfill(3))

Submission status: Wrong Answer

Solution code:
n=int(input())
print("AB"+("C" if n<1000 else "D")+str(n%1000))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
print(("ABC"+str(n).zfill(3))if n<1000 else ("ABD"+str(n-999).zfill(3)))

Submission status: Wrong Answer

Solution code:
N = int(input())
if N <= 999:
    print('ABC'+str(N).zfill(3))
else:
    print('ABD'+str(N-999).zfill(3))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

n = input()

print('ABD' + n if int(n) >= 1000 else 'ABC' + n)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
from string import ascii_uppercase
import sys, bisect
stdin = sys.stdin
read_int = lambda : list(map(int,stdin.readline().split()))
read_str = lambda : stdin.readline().rstrip()

N = read_int()[0]

def solve():
    ans = ""
    if N < 1000:
        ans = "ABC{:03}".format(N)
    else:
        ans = "ABD{:03}".format(N-999)
    return ans

if __name__ == "__main__":
    print(solve())

Submission status: Wrong Answer

Solution code:
l=list(input())
if len(l)==4:
  print("ABD"+l[1]+l[2]+l[3])
elif len(l)==3:
  print("ABC"+l[0]+l[1]+l[2])
elif len(l)==2:
  print("ABC"+"0"+l[0]+l[1])
else:
  print("ABC"+"00"+l[0])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
import math
from collections import defaultdict
 
N = int(input())
 
memo = defaultdict(lambda: -1)
memo[0] = 0
def recursive(n):
    if memo[n] != -1:
        return memo[n]
    
    min_num_operation = n
    
    index = 0
    temp_n = n
    while temp_n > 0:
        if temp_n % 9 == 0:
            index += 1
            temp_n /= 9
        else:
            break
    if index > 0:
        min_num_operation = min(min_num_operation, 1 + recursive(int(n - math.pow(9, index))))
        
    index = 0
    temp_n = n
    while temp_n > 0:
        if temp_n % 6 == 0:
            index += 1
            temp_n /= 6
        else:
            break
    if index > 0:
        min_num_operation = min(min_num_operation, 1 + recursive(int(n - math.pow(6, index))))
        
    memo[n] = min_num_operation
    
    return min_num_operation
 
print(recursive(N))

Submission status: Wrong Answer

Solution code:
print('AB'+'CD'[len(input())-3])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input(' '))

def calc1(N):
  if N <= 999:
    return 'ABC' + str(N).zfill(3)
  else:
    return 'ABD' + str(-999 + N).zfill(3)

print(calc1(N))

Submission status: Wrong Answer

Solution code:
N = int(input(' '))

def calc1(N):
  if N <= 999:
    return 'ABC' + str(N)
  else:
    return 'ABD' + str(-999 + N)

print(calc1(N))

Submission status: Wrong Answer

Solution code:
n = int(input())

if n < 1000:
    a = 'ABC'
    b = str(n).zfill(3)
else:
    a ='ABD'
    b = str(n-1000+1).zfill(3)
    
print(a+b)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=int(input())
if N<1000:
    print('ABC'+str(N))
else:
    print('ABD'+str(((N%1000)+1)))

Submission status: Wrong Answer

Solution code:
import math
def dfs(cost, N):
    if N<6 :
        return cost+N
    else:
        ret0 = 6 ** math.floor(math.log(N, 6))
        ret1 = 9 ** math.floor(math.log(N, 9))
        if (ret0>1) and (ret1>1):
            return min(dfs(cost+1, N-ret0), dfs(cost+1, N-ret1))
        else:
            ret = max(ret0, ret1)
            return dfs(cost+1, N-ret)

N = int(input())
print(dfs(0, N))

Submission status: Wrong Answer

Solution code:
contest = [int(a) for a in input()]
contest1 = contest[0]

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

Submission status: Wrong Answer

Solution code:
contest =[int(a) for a in input()]
contest1 = contest[0]

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

Submission status: Wrong Answer

Solution code:
contest =[int(a) for a in input()]
contest1 = contest[0]

if contest1 < 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:
if(int(input()) > 1000):
  print("‪ABD")
else:
  print("ABC")

Submission status: Wrong Answer

Solution code:
n = int(input())

if n<1000:
    print("ABC"+str(n).zfill(3))
else:
    print("ABD"+str(n-999).zfill(3))

Submission status: Wrong Answer

Solution code:
print("AB"+"CD"[len(input())-3])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
if(n > 999):
	print("ABD{}".format(n % 1000))
else:
	print("ABC{}".format(n))

Submission status: Wrong Answer

Solution code:
N=int(input())
if N<1000:
  print("ABC"+str(N).zfill(3))
else:
  print("ABD"+str(N-1000+1).zfill(3))

Submission status: Wrong Answer

Solution code:
N=int(input())
if N<1000:
  print("ABC"+str(N).zfill(3))
else:
  print("ABD"+str(N+1).zfill(3))

Submission status: Wrong Answer

Solution code:
N=int(input())
if N<1000:
  print("ABC"+str(N-1).zfill(3))
else:
  print("ABD"+str(N-1).zfill(3))

Submission status: Wrong Answer

Solution code:
s=input().zfill(3)
print('AB'+['C','D'][len(s)>3]+s[-3:])

Submission status: Wrong Answer

Solution code:
num = str(input())

newNum = (3 - len(num)) * "0" + num

if 1000 <= int(num):
    print("ABD" + str(int(newNum) - 1000))
else:
    print("ABC" + newNum)

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 < 1999:
	print('ABD')
else:
	print('ABC')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
print("AB"+"CD"[input()>"999"])

Submission status: Wrong Answer

Solution code:
N = int(input())
if N >=1000:
  print('ABD'+str(N%1000+1).zfill(3))
else:
  print('ABC'+str(N).zfill(3))

Submission status: Wrong Answer

Solution code:
def main() -> None:
    N = int(input())
    print(f(N))


def f(N: int) -> str:
    s = ""
    if N < 1000:
        s = "ABC{}"
    else:
        s = "ABD{}"

    return s



if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
a=int(input())
if a<1000:
  print(a)
else:
  print(a-999)

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:
n=int(input())
if n>1000:
  print("ABD")
else:
  print("ABC")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
import sys
sys.setrecursionlimit(100000)
N = int(input())

def rec(N, num, A):
    if N <= 5:
        num += N
        A.append(num)
        return A
    if N <= 8:
        num += N - 5
        A.append(num)
        return A
    p = int(math.log(N) / math.log(6))
    rec(N - 6**p, num+1, A)
    p = int(math.log(N) / math.log(9))
    rec(N - 9**p, num+1, A)
    return A

A = rec(N, 0, [])
print(min(A))

Submission status: Wrong Answer

Solution code:
import math
N = int(input())

dp = [10**7 for i in range(100010)]
dp[0] = 0

for i in range(1,N+1):
    dp[i] = min(dp[i-1]+1,min([dp[i-pow(6,j)]+1 for j in range(int(math.log(i,6)+1))]),min([dp[i-pow(9,j)]+1 for j in range(int(math.log(i,9))+1)]))

print(dp[N])

Submission status: Wrong Answer

Solution code:
print("ABD")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a = int(input())
isD = False
if 1000 <= a:
    a = a % 1000 + 1
    isD = True
print("{}{}".format("ABD"if isD else "ABC", a))

Submission status: Wrong Answer

Solution code:
print("AB"+["C","D"][len(input())<4])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
if n > 999:
	print('ABD')
else:
	print('ABD')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

N = int(input())
# A = [int(x) for x in input().split()]


C = [1]
for i in range(math.ceil(math.log(N,9)) + 3):
    if i !=0 :
        C.append(9 ** i)
for i in range(math.ceil(math.log(N,6)) + 3):
    if i != 0:
        C.append(6 ** i)


INF = 10**10
dp = [INF] * (N+1)
dp[0] = 0

for i in range(1,N+1):
    for c in C:
        if i - c >= 0:
            dp[i] = min(dp[i], dp[i - c] + 1)

print(dp[N])

Submission status: Wrong Answer

Solution code:
N = int(input())

print('AB', end='')
print('C' + str(N) if N < 1000 else 'D' + str(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:
print("ABC{}".format(int(input())%999))

Submission status: Wrong Answer

Solution code:
N = int(input())

if N <= 999:
    print("ABC" + str(N))
else:
    print("ABD"+str(N))