#include #include #include #include #include const char ABC[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; const int SIZE = (sizeof(ABC) - 1); int input_num() { int n = 0; char buff[256]; if (fgets(buff, sizeof(buff), stdin) != 0) { n = atoi(buff); } return n; } const char *calc(const int N, std::string &buff) { int n = N + 1; do { n -= 1; buff += ABC[n % SIZE]; n /= SIZE; } while (n != 0); std::reverse(buff.begin(), buff.end()); return buff.c_str(); } int main() { const int N = input_num(); std::string buff; printf("%s\n", calc(N, buff)); return 0; }