Go: package main

import (
	"bufio"
	"os"
	"strconv"
	"fmt"
)

var scanner= bufio.NewScanner(os.Stdin)

func main() {
	for scanner.Scan() {
		n, _ := strconv.Atoi(scanner.Text())
		if n%39 == 0 {
			fmt.Println(fmt.Sprintf("3C%02d", 39))
			continue
		}
		fmt.Println(fmt.Sprintf("3C%02d", n%39))
	}
}

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<time.h>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double EPS=1e-10;
const int inf=1e8;
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
int main(){
	int n;
	while(cin>>n){
		int d=(n-1)%39+1;
		cout<<"3C";
		cout<<(d/10==0?"0":"")<<d<<endl;
	}
}

C++: #include<iostream>
#include<algorithm>
#include<string>
#include <vector>

using namespace std;

int main(){

	int n;

	while(cin>>n){

	while(n>=39){
		n=n-39;
	}

	if(n==0){
		n=39;
	}

	printf("3C%d",n);
	}
}

C++: #include<iostream>
#include<cstdio>
using namespace std;
int main(){
int in;
while(cin>>in){
printf("3C%02d\n",(in-1)%39+1);
}
}

C++: #include<iostream>
#include<string>
#include<stdio.h>
#include<cstdio>
#include<math.h>
using namespace std;
int main(){
    int a,o;
    while(cin>>a){
        o=a%39;
        if(o==0){
            cout<<"3C39"<<endl;
        }
        else{
        cout<<"3C";
            printf("%02d",o);
            cout<<endl;
        }
    }
    return 0;
}

C++: #include<iostream>
#include<cstdio>
#include <cstring>
#include<map>
#include<string>
#include<stack>
#include <algorithm>
#include <sstream>
#include<vector>
#include<map>
#include<cmath>
using namespace std;

int StringToInt(string str)
{
            stringstream ss(str);
             int i;
             ss >> hex >> i;
             return i;
}


int main(){
	int n;
	while(cin>>n)
	{
	n=n%39;
	if(n==0)puts("3C39");
	else if(0<=n &&n<=9) cout<<"3C0"<<n<<endl;
	else cout<<"3C"<<n<<endl;
	}

	return 0;
}

C++: #include <iostream>
using namespace std;
int main(void)
{
	int n;
	while(cin>>n){
		cout << "3C";
		printf("%.2d\n",n%39?n%39:39);
	}
	return 0;
}

C++: // 2011/01/31 Tazoe

#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
using namespace std;

int main()
{
	while(!cin.eof()){
		string str;
		getline(cin, str);
		if(str.empty())
			continue;

		istringstream ist(str);
		int n;
		ist >> n;

		int num = n%39;
		if(num==0)
			num = 39;

		cout << "3C" << setw(2) << setfill('0') << num << endl;
	}

	return 0;
}

C++: #include<iostream>
#include<string.h>
#include<vector>
#include<list>
#include<stdio.h>
#include<math.h>
#include<iomanip>
#include<map>
#include<stack>
#include<queue>
#include<algorithm>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define debug(x) cout << "debug " << x << endl;
using namespace std;

int main(){
    int n;
    while(cin >> n){
        cout << "3C";
        cout << setw(2) << setfill('0') << right;
        cout << n % 39 << endl;
    }
}

C++: #pragma GCC optimize "-O3"
#pragma GCC target ("avx")
#define _USE_MATH_DEFINES
#include<numeric>
#include<bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;++i)
#define vi vector<int>
#define vvi vector<vi>
#define pb push_back
#define pi pair<int,int>
#define vp vector<pair<int,int>>
#define mp make_pair
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
#define MEMSET(a) memset(a,0,sizeof(a))
#define inf (1ll<<60)
#define SORT(v) sort(all(v))
#define RSORT(v) sort(all(v),greater<int>())
#define SPEED ios::sync_with_stdio(false);cin.tie(0);cout<<fixed<<setprecision(12)
signed gcd(int a, int b){return b?gcd(b,a%b):a;}
signed lcm(int a, int b){return a*b/gcd(a,b);}
//priority_queue<int, vi, greater<int> > que;//æ˜‡é †

using namespace std;

const int mod=1e9+7;

signed main(){
  SPEED;
  int a;
  while(scanf("%d",&a)!=EOF){
    printf("3C%02d\n",(a-1)%39+1);
  }
  return 0;
}

C++: #include<stdio.h>
int main(){int n;while(scanf("%d",&n)!=EOF){n%=39;if(n==0)n=39;(n<10)?printf("3C0"):printf("3C");printf("%d\n",n);}}

C++: #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>

using namespace std;

int main(){
	
	int n, ans;

	while(true){
		cin >> n;
		if(cin.eof()){
			break;
		}
		ans = (n - 1) % 39 + 1;
		if(ans >= 10){
			printf("3C%d\n", ans);
		}else{
			printf("3C0%d\n", ans);
		}
	}
	
	return 0;
}

C++: 
#include <bits/stdc++.h>
#include <stdio.h>
#include <numeric>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define repone(i,n) for(int i=1;i<(int)(n);++i)
#define repo(i,o,n) for(int i=o;i<(int)(n);++i)
#define Rep(j,n) for(int j=0;j<(int)(n);++j)
#define Repo(j,o,n) for(int j=o;j<(int)(n);++j)
#define Repone(j,n) for(int j=1;j<(int)(n);++j)
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define int long long
#define pb(a) push_back(a)
#define pbpair(a,b) push_back(make_pair(a,b))
#define MOD 1000000007
#define INF 9223372036854775807
#define pairint pair<int,int>
typedef pair< pairint , string> P;
//実装案　勝たなかった試合＆負けた試合のベクター　照準ソートして上から
int gcd( int x, int y ){ return y ? gcd(y, x%y) : x; }
bool pairCompare(const P& firstElof, const P& secondElof)
{
  if(firstElof.first.first!= secondElof.first.first)    return firstElof.first.first< secondElof.first.first;
else if(firstElof.first.second != secondElof.first.second)    return firstElof.first.second< secondElof.first.second;
else return false;
}
signed main() {
int x=0,y=0,z=0,w=0,n=0,m=0;
string k;
while(std::cin >> x){
for(;;){
  if(x-39>0)x-=39;
  else break;
}
if(x<10)std::cout <<"3C0"<<x << '\n';
else std::cout << "3C" <<x <<'\n';
}
}

C++: #include<iostream>
using namespace std;
int n;
int main(){
  while(cin>>n){
    cout<<"3C";
    if(n%39!=0){
      if(n%39<10)cout<<"0";
      cout<<n%39<<endl;
    }
    else cout<<"39"<<endl;
  }
  return 0;
}

C++: #include<iostream>

using namespace std;


int main(){
	int candy,i,j;

	while(cin >> candy){
		while(candy > 39){
			candy = candy - 39;
		}

		if(candy>9){
			cout << "3C" << candy << endl;
		}else{
			cout << "3C0" << candy << endl;
		}
	}
}

C++: // clang-format off
#include <bits/stdc++.h>
#define int long long
#define main signed main()
// #define main int main()
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecision(n)
#define stlice(from, to) substr(from, (to) - (from) + 1)
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
using namespace std;
using pii = pair<int, int>;
using vi = vector<int>;
using vd = vector<double>;
using vc = vector<char>;
using vb = vector<bool>;
using vs = vector<string>;
using vpii = vector<pii>;
using vvi = vector<vi>;
using vvb = vector<vb>;
using vvpii = vector<vpii>;
template<typename A> using fn = function<A>;
constexpr int INF = sizeof(int) == sizeof(long long) ? 1000000000000000000LL : 1000000000;
constexpr int MOD = 1000000007;
constexpr double PI = acos(-1);
template<typename A, typename B> bool cmin(A &a, const B &b) { return a > b ? (a = b, true) : false; }
template<typename A, typename B> bool cmax(A &a, const B &b) { return a < b ? (a = b, true) : false; }
constexpr bool odd(const int &n) { return n & 1; }
constexpr bool even(const int &n) { return !odd(n); }
void solve();
main { solve(); return 0; }
// clang-format on

template<typename M>
void warshallFloyd(M &m, const int &n) {
  rep(k, n) rep(i, n) rep(j, n) cmin(m[i][j], m[i][k] + m[k][j]);
}

void solve() {
  int n;
  while (cin >> n) {
    n = n % 39 + 39 * (n % 39 == 0);
    cout << "3C" << setfill('0') << setw(2) << n << endl;
  }
}