#include <cstdlib>
#include <iostream>

using namespace std;

void expb(int x, int b)
{
     if ( x<b )
        cout << x;
     else
        {
         expb(x/b, b);
         cout << x%b;
        }
        
}

int main(int argc, char *argv[])
{
    expb(23,3);
    cout << endl;
    system("PAUSE");
    return EXIT_SUCCESS;
}
