#include using namespace std; #define ll long long #define ul unsigned long long #define pb push_back #define ss second #define ff first #define fr(m) for(int i=0; i=0; --i) #define nl '\n' #define yes cout<<"YES"<>s; int sz=s.size(); char last=s[sz-1]; char s_last=s[sz-2]; if((s_last=='c' && last=='h') || last=='x' || last=='s' ||last=='o') s=s+"es"; else if(last=='f') { s.pop_back(); s=s+"ves"; } else if(s_last=='f' && last=='e') { s.pop_back(); s.pop_back(); s=s+"ves"; } else if(last=='y') { s.pop_back(); s=s+"ies"; } else { s=s+"s"; } cout<> TC; while (TC--) solve(); }