#include using namespace std; using ll = long long; #define rep(i,m,n) for(int i=m; i> S; int n = S.size(); if(S.substr(n-2,2) == "ai"){ cout << S.substr(0, n-2) << "AI" << endl; }else{ cout << S << "-AI" << endl; } return 0; }