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.
The words should be output in the same order as they appear in input.
Input
Output
3
AUTO
TOVAR
DRVOOutput
TOVAR
DRVOInput
Output
4
MANDARINA
VIDEO
KOMPJUTER
NAZIVOutput
VIDEO
KOMPJUTER
NAZIVInput
Output
4
STOLICA
CAR
ARMIJA
JASTUKOutput
JASTUKSubmit solution
Coming laterThe grading service will be connected in a later migration step. You can inspect the task and your previous results now.