Problem:


キャンディーとクラス旗

3年C組では、平成19年11月10日の体育祭で使用する「クラス旗」を、将来のクラス会の時にも使うことにしました。そこで「クラス旗」を保管する生徒を決めるために、先生が先日差し入れてくれた大量のキャンディーを使って次のようなゲームを行うことにしました。

各生徒は生徒番号の順に１個ずつキャンディーを取ります。

一巡してもキャンディーが残っていたら、最初の生徒番号の人から順々にキャンディーを取り続けます。

最後のキャンディーを取った人が「クラス旗」を保管する生徒になります。

3年C組のクラスの人数は 39 人です。彼らの生徒番号は 3C01 から 3C39 です。例えば、キャンディーの数が 50 個の場合、クラス全員が１個目のキャンディーを取り終えると、キャンディーの残りは 11 個となります。それを再び生徒番号順に取ると、最後の 1 個は、3C11 の生徒が取ることとなります。すなわち 3C11 の生徒が「クラス旗」を保管する生徒となります。

キャンディーの個数を入力とし、「クラス旗」を保管する生徒の生徒番号を出力するプログラムを作成してください。

Input

複数のテストケースが与えられます。各テストケースは以下の形式で与えられます。各テストケースとして、キャンディーの個数を表す整数 a (1 ≤ a ≤ 10000) が１行に与えられます。入力の最後(EOF)まで処理してください。

データセットの数は 20 を超えません。

Output

各テストケースごとに、「クラス旗」を保管する生徒の生徒番号（半角英数字）を１行に出力してください。

Sample Input

50
5576
5577
5578

Output for the Sample Input

3C11
3C38
3C39
3C01



Sample input:
50
5576
5577
5578


Sample output:
3C11
3C38
3C39
3C01

Submission status: Wrong Answer

Solution code:
while True:
	try:
		n = int(raw_input())
	except EOFError:
		break
	
	if n < 39:
		print "3C" + str(n)
	elif n % 39 == 0:
		print "3C39"
	else:
		x = n % 39
		if x < 10:
			print "3C0" + str(x)
		else:
			print "3C" + str(x)

Submission status: Wrong Answer

Solution code:
while True:
	try:
		n = int(raw_input())
	except EOFError:
		break
	
	if n == 0:
		print "3C01"
	elif n < 39:
		print "3C" + str(n)
	elif n % 39 == 0:
		print "3C39"
	else:
		x = n % 39
		if x < 10:
			print "3C0" + str(x)
		else:
			print "3C" + str(x)

Submission status: Wrong Answer

Solution code:
while True:
    try:
        a = int(input())
    except:
        break
    tmp = a - (a // 39) * 39
    print("3C{:02d}".format(39 if tmp == 39 else tmp))

Submission status: Wrong Answer

Solution code:
while True:
    try:
        n = int(raw_input())
        print "3C{0:0>2}".format(n % 39)
    except EOFError:
        break

Submission status: Wrong Answer

Solution code:
while True:
    try:
        n = int(raw_input())
        print "3C{0:0>2}".format(n % 39)
    except:
        break

Submission status: Accepted

Solution code:
import sys
for s in sys.stdin:
  print '3C%02d' %((int(s)-1)%39+1)

Submission status: Accepted

Solution code:
while 1:
  try: print '3C%02d' %((input()-1)%39+1)
  except: break

Submission status: Accepted

Solution code:
while True:
    try:
        c = int(raw_input())
    except EOFError:
        break
    if c%39 ==0:
        print '3C39'
    else:
        print '3C' + str(c%39).zfill(2)

Submission status: Accepted

Solution code:
import sys

for line in sys.stdin:
    n = int(line.rstrip())
    while n > 39:
        n = n-39*(n/39)
        if n == 0:
            print '3C%s' % 39
            break
    else:
        print '3C%s' % str(n).zfill(2)

Submission status: Accepted

Solution code:
while True:
	try:
		n = int(raw_input())
	except EOFError:
		break
	
	if n < 39:
		if n < 10:
			print "3C0" + str(n)
		else:
			print "3C" + str(n)
	elif n % 39 == 0:
		print "3C39"
	else:
		x = n % 39
		if x < 10:
			print "3C0" + str(x)
		else:
			print "3C" + str(x)

Submission status: Accepted

Solution code:
while True:
    try:
        n = int(input())
        num = n % 39
        if num == 0:
            num = 39
        if num < 10:
            num = "0" + str(num)
        print("3" + "C" + str(num))
    except EOFError:
        break

Submission status: Accepted

Solution code:
while 1:
    try:n=int(input())
    except:break
    print("3C{:02d}".format(n%39 if n%39 else 39))

Submission status: Accepted

Solution code:
while True:
    try:
        c= int(input())
    except:
        break
    c%= 39
    print("3C0"+str(c) if len(str(c))==1 and c> 0 else ("3C39" if not c else "3C"+str(c)))

Submission status: Accepted

Solution code:
while True:
    try:
        n = int(input().strip())
        m = n % 39 
        if m==0:
            s = "39"
        else:
            s = "%02d" % m
        print("3C" + s)
    except EOFError:
        break

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0148

"""
import sys
from sys import stdin

input = stdin.readline


def main(args):
    for line in sys.stdin:
        candy = int(line)
        hit = candy % 39
        if hit == 0:
            hit = 39
        print('3C{:02d}'.format(hit))



if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Accepted

Solution code:
while True:
    try:
        a = int(input())
    except:
        break
    tmp = a - (a // 39) * 39
    print("3C{:02d}".format(tmp if tmp % 39 else 39))

Submission status: Accepted

Solution code:
import sys

COUNT = 39

for line in sys.stdin:

    num = int(line[:-1])

    result = num % COUNT

    if result == 0:
        result = COUNT

    print("3C%02d" % result)

Submission status: Accepted

Solution code:
def get_input():
    while True:
        try:
            yield ''.join(input())
        except EOFError:
            break

N = list(get_input())

for l in range(len(N)):
    n = int(N[l])
    print("3C", end="")
    ans = n % 39
    if ans == 0:
        print(39)
    elif ans < 10:
        print("0", end="")
        print(ans)
    else:
        print(ans)

Submission status: Accepted

Solution code:
# AOJ 0148 Candy and Class Flag
# Python3 2018.6.18 bal4u

while True:
	try: a = (int(input())-1) % 39 + 1
	except: break
	print("3C", format(a, "02d"), sep='')

Submission status: Accepted

Solution code:
while True:
  try:
    print("3C", str((int(input()) - 1) % 39 + 1).zfill(2), sep="")
  except EOFError:
    break

Submission status: Accepted

Solution code:
while True:
  try: 
    a = int(input()) ; ans=a%39
    if ans ==0: print "3C39"
    elif ans < 10:  print "3C0%d"%(ans)
    else:  print "3C%d"%(ans)
  except EOFError: break

Submission status: Accepted

Solution code:
while 1:
    try:
        num = int(raw_input()) % 39
        zgok = str(num).zfill(2)
        if zgok == "00": zgok = "39"
        print "3C%s" % zgok
    except EOFError: break

Submission status: Accepted

Solution code:
import sys
for line in sys.stdin:
    n=int(line.strip())
    a=n%39
    if a<10:s="3C0{}".format(a)
    if a==0:s="3C39"
    if a>=10:s="3C{}".format(a)
    print s

Submission status: Accepted

Solution code:
while True:
    try:
        n=input()
    except EOFError:
        break
    t=n%39
    print "3C%02d"%(t if t!=0 else 39)

Submission status: Accepted

Solution code:
while True:
    try:
        n = int(raw_input())
        print "3C{0:0>2}".format(n % 39 if n % 39 != 0 else 39)
    except:
        break

Submission status: Accepted

Solution code:
while True:
    try:
        n = int(raw_input())
        m = n % 39
        print "3C{0:0>2}".format(m if m != 0 else 39)
    except:
        break

Submission status: Accepted

Solution code:
L = [39]+range(1,39)
while True:
    try:
        print "3C{0:02d}".format(L[input()%39])
    except:
        break

Submission status: Accepted

Solution code:
import sys
for s in sys.stdin.readlines():
    print "3C"+str(1+(int(s.strip())-1)%39).zfill(2)

Submission status: Accepted

Solution code:
while 1:
	try: print "3C%02d"%((input()-1)%39+1)
	except: break

Submission status: Accepted

Solution code:
import sys

for i in sys.stdin:
    p = int(i) % 39
    if p == 0:
        print("3C39")
    elif p < 10:
        print("3C0%d" %(p))
    else:
        print("3C%d" %(p))

Submission status: Accepted

Solution code:
try:
    while True:
        ame = int(input())
        num1 = ame % 39
        if num1 == 0:
            num1 = 39
        if num1 < 10:
            print("3C0" + str(num1))
        else:
            print("3C" + str(num1))
except EOFError as e:
    num = 0

Submission status: Accepted

Solution code:
while True:
    try:
        a = int(input())
    except:
        break
    a = str(a%39)
    if a == "0":
        a = "39"
    elif len(a) == 1:
        a = "0"+a
    print("3C"+a)

Submission status: Accepted

Solution code:
while True:
    try:
        num = int(input())
    except:
        break
    
    s = (num-1)%39 + 1
    print("3C{:02}".format(s))

Submission status: Accepted

Solution code:
while True:
    try:
        n=int(input())
        S=(n-1)%39+1
        print("3C",format(S,"02d"),sep="")
    except:
        break

Submission status: Accepted

Solution code:
while True:    
    
    try:
        n = int(input())
    except:
        break
    
    ans = n % 39
    if ans == 0:
        ans = "39"
    else:
        ans = "{0:02d}".format(ans)
    print("3C"+ans)

Submission status: Accepted

Solution code:
while True:
  try:
    a = int(input())
  except:break
  if a%39 == 0:
        print("3C39")
  else:
    b = a // 39
    c = a - 39 * b
    if c < 10:
      print("3C0",c,sep='')
    else:
      print("3C",c,sep='')

Submission status: Accepted

Solution code:
while True:
  try:
    print("3C",str((int(input())-1)%39+1).zfill(2),sep="")
  except EOFError:
    break

Submission status: Accepted

Solution code:
while True:
  try:
    n = int(input())
  except:
    break
    
  if n % 39 == 0:
    ans = 39
  else:
    ans = n % 39
    
  print("3C" + str(ans).zfill(2))

Submission status: Accepted

Solution code:
while 1:
    try:n=int(input())
    except:break
    print("3C{:02d}".format(n%39 if n%39 else 39))

Submission status: Accepted

Solution code:
while 1:
    try:
        n = int(input())
    except:
        break

    if n % 39 == 0:
        ans = 39
    else:
        ans = n % 39

    print("3C" + str(ans).zfill(2))

Submission status: Accepted

Solution code:
while True:
    try: n = int(input())
    except: break
    n = n % 39
    if not n:
        print('3C39')
    else:
        print('3C{:02}'.format(n))

Submission status: Runtime Error

Solution code:
while True:
    n = raw_input()
    if not n:
        break
    else:
        n = int(n)
        print "3C{0:0>2}".format(n % 39)