// No.536 人工知能 // https://yukicoder.me/problems/no/536 // #include #include using namespace std; string solve(string &S); int main() { string S; cin >> S; string ans = solve(S); cout << ans << endl; } string solve(string &S) { regex rx(R"(ai$)"); string rep = "AI"; smatch m; if (regex_search(S, m, rx)) { return regex_replace(S, rx, rep); } else { return S + "-AI"; } }