// Nikita Golikov, 2023 #include using namespace std; using uint = unsigned int; using ll = long long; using ull = unsigned long long; #ifdef GOLIKOV #include "/Users/golikovnik/contests/debug.h" #else #define debug(...) ; #endif template bool smin(A& x, B&& y) { if (y < x) { x = y; return true; } return false; } template bool smax(A& x, B&& y) { if (x < y) { x = y; return true; } return false; } int main() { #ifdef GOLIKOV assert(freopen("in", "rt", stdin)); auto _clock_start = chrono::high_resolution_clock::now(); #endif ios::sync_with_stdio(false); cin.tie(nullptr); map mp; int q; cin >> q; auto get = [&](int x) { ++x; string ans; while (x > 0) { ans.push_back(char('a' + (x % 26))); x /= 26; } return ans; }; while (q--) { string s; cin >> s; int len = int(s.size()); int dot = 0; while (dot < len && s[dot] != '.') { ++dot; } if (dot < len) { assert(len >= 2); if (s[len - 2] == '0') { int ptr = len - 2; while (ptr >= 0 && s[ptr] == '0') { --ptr; } s = s.substr(0, ptr + 1 - (s[ptr] == '.')) + "L"; } debug(s); } if (!mp.count(s)) { mp[s] = get(int(mp.size())); } cout << mp[s] << '\n'; } #ifdef GOLIKOV cerr << "Executed in " << chrono::duration_cast( chrono::high_resolution_clock::now() - _clock_start).count() << "ms." << endl; #endif return 0; }