*s,=input().replace('[?]','*');print(*[('a','A')[i==0 or s[i-2]in'.?!']+'n'*(s[i+2]in 'aeiouAEIOU')if c=='*'else c for i,c in enumerate(s)],sep='')
[?] apple [?] day keeps the doctor away. [?] lie.
An apple a day keeps the doctor away. A lie.
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!