Romulan Spelling |
The Romulans use a language that can be approximated with the English alphabet and normal punctuation marks. Their spelling rules are even stranger than English, however. In particular, they have a rule that states:
G before P except after E or when pronounced X as in npgukbor or wpguk.
Operationally, you can detect the X pronounciation by the string PGUK appearing in the word. Also, the Romulan rules for capitalization are different from ours, so capital letters can appear anywhere in a word.
Given a file containing lines of Romulan text, you are to output the text with spelling corrected according to the G before P except after E rule given above. No input line will contain more than 70 characters including spaces.
For example, the input file corresponding to the romulan translation of the quote:
"I received the wierd piece of pie from my neighbor sam who in turn recieved the weird peice of pei from his nieghbor harry," might well be ...
I rpEpgvpd tKp wgprd tgpEp of tgp from my npguKbor sam wKo gn turn rpEgpvpd tKp wpgrd tpgEp of tpg from Kgs ngpuKbor Karry,
I rpEpgvpd tKp wgprd tgpEp of tgp from my npguKbor sam wKo gn turn rpEpgvpd tKp wgprd tgpEp of tgp from Kgs npguKbor Karry,