Time limit
2s
Memory limit
128 MB
The Minsik language has the following 20 letters, and dictionary order follows this order.
a b k d e g h i l m n ng o p r s t u w y
The sequence ng is not two separate letters; it is treated as one letter placed between n and o. Whenever ng appears in a word, compare it as that single letter.
Given several words in the Minsik language, sort them in dictionary order according to this alphabet.
The first line contains the number of Minsik language words, N. N is a positive integer not greater than 50.
Each of the next N lines contains one Minsik language word. Each word has length at most 50. No input word contains a letter outside the Minsik alphabet, and all words are distinct.
Print the sorted words, one per line.