#C14913. Smallest Lexicographical Permutation

    ID: 44615 Type: Default 1000ms 256MiB

Smallest Lexicographical Permutation

Smallest Lexicographical Permutation

You are given a list of words. Your task is to remove any duplicate words from the list and then output the unique words in their smallest lexicographical order. More formally, if you let \(W\) be a list of words, you must produce a sorted list \(S\) such that \(S\) contains each word from \(W\) exactly once and for any two words \(a, b \in S\) with \(a \neq b\), \(a\) comes before \(b\) in dictionary order.

Input Format: The input is read from standard input (stdin). The first line contains an integer \(n\), representing the number of words. The next line contains \(n\) words separated by single spaces.

Output Format: Output the unique words sorted in lexicographical order separated by a single space. If the list is empty, output nothing.

Example:

Input:
6
beta alpha beta delta gamma alpha

Output: alpha beta delta gamma

</p>

inputFormat

The first line of input contains an integer \(n\) representing the number of words. The second line contains \(n\) words separated by a single space.

outputFormat

Output the unique words sorted in lexicographical order separated by spaces. If there are no words, output an empty line.

## sample
6
beta alpha beta delta gamma alpha
alpha beta delta gamma