#include <iostream>
using namespace std;
int main (void){


  int n ,a;


  while(1){
  

  cin >> n ;

  if ( n == 0) break;


  a = n % 39;


    if(  a > 0   &&  a < 10) cout << "3C0"  <<  a  <<endl;
    else if( a >= 10 && a < 39) cout << "3C"  <<  a  <<endl;
    else if( a == 0) cout << "3C39"    <<endl;
  }


  return 0;
}