#include<iostream>
#include<algorithm>
using namespace std;
string convertTobase26(long long n){
    string res="";
    while(n>0){
        n--;
        res+=char('A'+(n%26));
        n/=26;
    }
    reverse(res.begin(),res.end());
    return res;
}
int main()
{
    int keyType;
    if(!(cin>>keyType)){
        cout<<"Invalid input";
        return 0;
    }
    if(keyType !=1 && keyType !=2)
    {
        cout<<"Invalid input";
        return 0;
    }
    if(n<1||n>2147483647){
        cout<<"Invalid input";
        return 0;
    }
    cout<<convertTobase26(n);
}
else{
    double f;
    if(!(cin>>f)){
        cout<<"Invalid input";
        return 0;
    }
    if(f<1.0||f>100000.0){
        cout<<"Invalid input";
        return 0;
    }
    long long n=(long long)f;
    cout<<convertTobase26(n);
}
return 0;
}