#include<iostream>
using namespace std;
int main(){
	while(true){
		int kyandhi,hito;
		cin >> kyandhi;
		if(kyandhi == 0)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;
		}
	}
	return 0;
}