#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main ()
{
    char buf[100];
    if(!fgets(buf, sizeof(buf), stdin)) {
        printf("Invalid Input");
        return 0;
    }
    char *end;
    long n = strtol(buf , &end, 10);
    while(*end == '' || *end == '\t' || *end == '\n' || *end == '\r')
    end++;
    if(*end != '\0') {
        printf("Invalid Input");
        return 0;
    }
   if(n <= 0) {
       printf("-1");
       return 0;
   }
   char res[20];
   int idx=0;
   while(n>0) {
       n--;
       int rem = n%26;
       res[idx++] = 'A' + rem;
       n/=26;
   }
   res[idx] = '\0';
   for(int i=0; i<idx/2; i++) {
       char tmp= res[i];
       res[i]=res[idx - 1- i];
   }
   printf("%s", res);
   return 0;
}