#000558

Kaladont

InputIn the first row of the input there is a natural number N (2 \leq M < 100 000). In the next N rows each there is a word of no less than 3 and no more than 30 uppercase letters of English alphabet.


OutputYou need to print all words whose last 2 letters together do not make a prefix of some other word, each on a separate line. There will always be at least one such word.
The words should be output in the same order as they appear in input.


Input
3
AUTO
TOVAR
DRVO

Output
TOVAR
DRVO


Input
4
MANDARINA
VIDEO
KOMPJUTER
NAZIV

Output
VIDEO
KOMPJUTER
NAZIV


Input
4
STOLICA
CAR
ARMIJA
JASTUK

Output
JASTUK

Submit solution

Coming later

The grading service will be connected in a later migration step. You can inspect the task and your previous results now.