#include #include using namespace std; int main() { string S; cin >> S; regex re("(.*)ai$"); smatch sm; if (regex_match(S, sm, re)) { cout << sm[1] << "AI" << endl; } else { cout << S << "-AI" << endl; } return 0; }