def number_to_excel_column(n):
    
    if not isinstance(n, int):
        return "Invalid"
        
    if n < 0:
        return -1
        
    result = ""
    while n > 0:
        n -= 1
        
        result = chr((n % 26) + ord('A')) + result
        n //= 26
        
    return result
    
try:
    n = int(input().strip())
    print(number_to_excel_column(n))
except:
    print("Invalid Input")