Problem A

As often happens, Atli was on his way to the University of Iceland to compete in a programming contest with a few other students. But since he was running late as per usual he had asked Bergur to buy snacks for him to have in the contest. But being from Akureyri, Atli speaks nothing but the purest of northern Icelandic and thus Bergur, being from the south, didn’t quite catch what he said. Now you need to translate the snack-list from Atli into southern Icelandic so Bergur can understand it. As is well known, people from southern Iceland are unable to pronounce the letter ‘k’ so all instances of the letter ‘k’ need to be replaced with a ‘g’. They don’t quite like the letter ‘y’ either and seem quite fond of replacing it with a ‘u’ so all ‘y’s also need to be replaced with ‘u’s. Southern Icelanders despise eliminating letters entirely though so this does not apply to ‘K’ and ‘G’. In addition to this there are a few snack-related words that need to be translated. Firstly norterners speak of ‘kók í bauk’ (meaning a can of cola) while southerners use the word ‘dós’ instead of ‘bauk’. Thus all instances of ‘bauk’ need to be changed for ‘dos’. Lastly there is disagreement on how to write the word for pizza so all instances of ‘flatbaka’ need to be replaced with ‘petsa’. It is important that replacing words takes precedent over replacing letters. For example ‘flatbakan’ would be turned into ‘petsan’ and not ‘flatbagan’ despite this sounding just southern enough to perhaps be understood. Since ‘Flatbakan’ and ‘Bauk’ might be names rather than nouns they shouldn’t be replaced in this manner.

Can you help Bergur figure out what snacks Atli wants him to buy?


The input is on one line, terminated by a newline character. The text can contain any letters in the English alphabet or spaces. There are at most $5 \cdot 10^5$ characters in the input line.


The same text as in the input but translated to southern Icelandic as described above.

Sample Input 1 Sample Output 1
griptu pylsu og kok i bauk
griptu pulsu og gog i dos
Sample Input 2 Sample Output 2
flatbaka fra akureyri
petsa fra agureuri

Please log in to submit a solution to this problem

Log in