# [SNOBOL4 (CSNOBOL4)], 148 bytes S =INPUT N S ARB . L ANY('aeiou') . C REM . S :F(O) EQ(X) :S(A) &LCASE @P C &UCASE LEN(P) LEN(1) . C A O =O L C X =1 - X :(N) O OUTPUT =O S END [Try it online!][TIO-kxxmuf41] [SNOBOL4 (CSNOBOL4)]: http://www.snobol4.org/csnobol4/ [TIO-kxxmuf41]: https://tio.run/##HY7LCsIwEEX3@Yq7sslCoeCqUDDWCEJNatOCLlutWl/x/fr5OnZ15twZLnM7udId@k0Di3CikzxjmkaZDtFDDKkX3Cuq2j08QUGEVE2JFsGYG8GgZnwuEFguSTpxJK3CIEFEkrcSK80T0cJvG5iEQWiom47mCH10CQHXghmYPKMP/mvLlB41TVEuV9V6s613@8Px5M6X6@3@eL7en@8P "SNOBOL4 (CSNOBOL4) – Try It Online"