시간 제한메모리 제한제출정답맞힌 사람정답 비율
4 초 (추가 시간 없음) 256 MB137846259.615%

문제

Two words are anagrams if the letters of the first word can be reordered to obtain the second one. An instance of anagrams is the pair “listen” and “silent”.

You are given a list of words, each word consisting of lowercase letters. Your goal is to filter this list by dropping any word whose anagram has already appeared earlier on the list.

입력

The first line contains $n$, the length of the list. This is followed by $n$ lines, each containing one word.

출력

Print out the list of words without anagrams, one word per line. The words should appear in the same order as given in the input.

제한

  • $1 ≤ n ≤ 10^5$
  • All letters are lowercase letters of the English alphabet.
  • Length of any word will not exceed $100$.

예제 입력 1

5
listen
santa
satan
silent
cat

예제 출력 1

listen
santa
cat