#include #define rep(i,a,b) for(int i=a;i> S; int N = S.length(); if (S[N - 2] == 'a' && S[N - 1] == 'i') printf("%sAI\n", S.substr(0, N - 2).c_str()); else printf("%s-AI\n", S.c_str()); }