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