#include <iostream>
#include <string>
#include <stack>
#include <queue>
#include <vector>
#include <algorithm>
#include <cmath>

using namespace std;

#define loop(i,a,b) for(int i=(a);i<int(b);i++)
#define rep(i,b) loop(i,0,b)
#define all(c) (c).begin(), (c).end()

int main(){
    int N;
    while (cin >> N&& N){
        N--;
        int ans = N % 39 + 1;
        cout << "3C" << (ans < 10 ? "0" : "") << ans << endl;
    }
}