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>
using namespace std;

#define STNUM 39

int main() {
  int cndy;

  while(cin>>cndy) {
    int c=cndy%STNUM;
    cout << "3C";
    if(c==0) cout << 39 << endl;
    else {
      if(c<10) cout<<"0";
      cout<<c<<endl;
    }
  }
  return 0;
}

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

using namespace std;

int main(){

	int n;
	while(cin>>n){
		cout<<"3C";
		printf("%02d\n",n%39);
	}
	
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(void)
{
	int i,j,k,n;
	while(scanf("%d",&n)!=EOF) {
		if(n%39==0) cout<<"3C39"<<endl;
		else if(n%39<10)cout<<"3C0"<<n%39<<endl;
		else cout<<"3C"<<n%39<<endl;
	}
}

C++: #include <stdio.h>

int main(void)
{
	int candy;
	int amari;
	
	while (scanf("%d" ,&candy) != EOF){
		
		amari = candy % 39;
		
		if (candy % 39 == 0){
			printf("3C39");
		}
		
		else if ((amari >= 1) && (amari <= 9)){
			printf("3C0%d" , amari);
		}
		
		else {
			printf("3C%d" , amari);
		}
	}
	
	return (0);
}

C++: #include <iostream>
#include <iomanip>
using namespace std;

int n;

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

C++: #include<stdio.h>

int main(){
int x;
while(scanf("%d",&x)!=EOF){
x=x%39;
if(x==0)x=39;
else x=x;
if(x<=9)printf("3C0%d\n",x);
printf("3C%d\n",x);
}
return 0;
}

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

C++: #include <iostream>
#include <cstdio>
using namespace std;

int main() {
	int in, out, tmp;

	while (1) {
		if (scanf("%d", &in) == EOF) break;

		tmp = in / 39;
		out = in - (tmp * 39);
		printf("3C");
		if (out == 0) printf("39\n");
		else if (out < 10) printf("0%d\n", out);
		else printf("%d\n", out);
	}
}

C++: #include <stdio.h>
int main(void)
{
	int candy, no=0;
	while(scanf("%d", &candy)!=EOF)
	{
		candy = ((candy-1)%39)+1;
		printf("3C%02d\n", candy);
	}
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
int main(){
	int n;
	while(cin>>n){
		cout<<"3C";
		if(n%39==0)cout<<39<<endl;
		else if(n%39<10)cout<<0<<n%39<<endl;
		else cout<<n%39<<endl;
	}
}

C++: #include<iostream>
using namespace std;

int main() {
	while (1) {
		int a;
		cin >> a;
		if (cin.fail())break;
		cout << "3C";
		if (a % 39 == 0) { cout << 39 << endl; continue; }
		cout.width(2);
		cout.fill('0');
		cout << a % 39 << endl;
	}
}

C++: #include <iostream>
#include <cstdio>
using namespace std;
int main( void )
{
	int n;
	while ( cin >> n && n )
	{
		int t = n % 39;
		if ( t == 0 ) t = 39;
		printf( "3C%02d\n", t );
	}
	return 0;
}

C++: #include <iostream>
#include <cstdio>
using namespace std;

int main(){
	int n;
	while(1){
		cin >> n;
		if(cin.eof()) break;
		printf("3C%02d\n",(n - 1) % 39 + 1);
	}
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cout.fill('0');
    while(cin>>n){
        if(n%39==0)cout<<"3C39"<<endl;
        else cout<<"3C"<<setw(2)<<n%39<<endl;
    }
}

C++: #include <iostream>
using namespace std;

int main(){
	int n;
	while(cin >> n){
		n %= 39;
		if(!n) n=39;
		cout << "3C" << n << endl;
	}
	return 0;
}

C++: #include <stdio.h>
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <map>
#include <fstream>
#include <sstream>
#include <math.h>
#include <queue>
#include <stack>
#include <math.h>

using namespace std;

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

C++: #include <bits/stdc++.h>
using namespace std;
int main(void){
    int n;
    while (cin>>n) {
        if (n<=39) {
            if (n/10==0) {
                cout<<"3C"<<0<<n<<endl;
            } else {
                cout<<"3C"<<n<<endl;
            }
        } else {
            while(n>39){
                n=n-39;
            }
            if (n/10==0) {
                cout<<"3C"<<0<<n<<endl;
            } else {
                cout<<"3C"<<n<<endl;
            }
        }
    }
}

C++: #include<iostream>
using namespace std;

int main() {
	while (1) {
		int a;
		cin >> a;
		if (cin.fail())break;
		cout << "3C";
		if (a % 39 == 0) { cout << 39; continue; }
		cout.width(2);
		cout.fill('0');
		cout << a % 39 << endl;
	}
}

C++: #include <iostream>
using namespace std;
int main(void){    
    int candy;
    while(cin >> candy){
        int num=candy % 39;
        if(num == 0) cout << "3C39" << endl;
        else if(num >= 1 && num <= 9) cout << "3C0" << candy % 39 << endl;
        else cout << "3C" << candy % 39 << endl;
    }
    
}

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

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

using namespace std;

int n;

int main() {
  while (cin >> n) {
    int rest = n % 39;
    if (!rest) rest = 39;
    printf("3C%02d\n", rest);
  }
  return 0;
}

C++: #include<stdio.h>
int main()
{
	int n;
	while(scanf("%d",&n)>0)
		printf("3C%02d\n",(n-1)%39+1);
	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
	while(true){
		int kyandhi,hito;
		cin >> kyandhi;
		if(kyandhi == EOF)break;
		hito = kyandhi % 39;
		
		if(hito == 0){
			cout << "3C" << 39 << endl;
		}
		else if(hito < 9){
			cout << "3C0" << hito << endl;
		}
		else if(hito != 0){
			cout << "3C" << hito << endl;
		}
	}
}

C++: #include<stdio.h>

int main(void){
	int i,kai;

	while(scanf("%d",i)!=EOF){
		i%=39;
		if(i==0)i=39;
		printf("%d\n",i);
	}
	return 0;
}

C++: #include <iomanip>
#include <iostream>
using namespace std;
int main()
{
	int n;
	while (cin>>n)
		cout << "3C" << setw(2) << setfill('0') << (n%39==0?39:n%39) << endl;
	return 0;
}

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

#define pb(n) push_back(n)
#define fi first
#define se second
#define all(r) (r).begin(),(r).end()
#define gsort(st,en) sort((st),(en),greater<int>())
#define vmax(ary) *max_element(all(ary))
#define vmin(ary) *min_element(all(ary))
#define debug(x) cout<<#x<<": "<<x<<endl
#define fcout(n) cout<<fixed<<setprecision((n))
#define scout(n) cout<<setw(n)
#define vary(type,name,size,init) vector< type> name(size,init)

#define rep(i,n) for(int i = 0; i < (int)(n);++i)
#define REP(i,a,b) for(int i = (a);i < (int)(b);++i)
#define repi(it,array) for(auto it = array.begin(),end = array.end(); it != end;++it)
#define repa(n,array) for(auto &n :(array))

using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using dict = map<string,int>;
using pii = pair<int,int> ;

constexpr int imax = ((1<<30)-1)*2+1 ;
constexpr int inf = 100000000;
constexpr double PI = acos(-1.0) ;
double eps = 1e-10 ;
const int dy[] = {-1,0,1,0};
const int dx[] = {0,-1,0,1};

inline bool value(int x,int y,int w,int h){
  return (x >= 0 && x < w && y >= 0 && y < h);
}

template<typename T>
void Unique(vector<T> &v){
  sort(all(v));
  v.erase(unique(all(v)),v.end());
}

template<typename T>
T ston(string& str, T n){
  istringstream sin(str) ;
  T num ;
  sin >> num ;
  return num ;
}

void Ans(bool f){
  if(f) cout << "YES"<<endl;
  else cout << "NO"<<endl;
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  while(cin>>n&&n){
    string s = to_string((n % 39 ==0)?39 : n%39);
    while(s.size()<2){
      s = "0"+s;
    }
    cout << "3C"<<s<<endl;
  }
  return 0;
}