#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<limits.h>

#define MAX_TITLE_LEN 10

void reverseString(char *str){
int length = strlen(str);
char *start = star;
char *end = str + length - 1'
while(start <end){
    char temp = *start;
    *start = *end;
    *end = temp;
    start++;
    end--;
}
}

int main(){
    char inputBuffer[20];
    long n_long;
    int n;
    char *endptr;
    
    if(fgets(inputBuffer,sizeof(inputBuffer),stdin) == NULL){
        printf("Invalid input");
        return 1;
    }
    
    inputBuffer[strcspn(inputBuffer,'\n')] = 0;
    n_long = strtol(inputBuffer,&endptr,10);
    
    if(endptr == inputBuffer || *endptr !='\0'){
        printf("Invalid input");
        return 0;
    }
    
    n = (int)n_long;
    
    char title[MAX_TITLE_LEN];
    int i = 0;
    
    while (n > 0){
        int remainder = (n-1%26);
        
        title[i++]='A'+remainder;
        
        n = (n-1) / 26;
    }
    title[i]='\0';
    reverseString(title);
    printf("%s",title);
    }
    return 0;
}