#include #include #include using namespace std; int main() { std::cin.tie(0); std::ios::sync_with_stdio(false); string S; cin >> S; if(S.size() < 2){ cout << S << "-AI" << endl; return 0; } string target = "ia"; int c = 0; for(auto itr = S.rbegin(); itr != S.rend(); itr++){ if(c >= target.size()) break; if(*itr != target[c]){ break; } c++; } if(c >= 2){ S.at(S.size() - 1) = 'I'; S.at(S.size() - 2) = 'A'; cout << S << endl; }else{ cout << S << "-AI" << endl; } return 0; }