#D11591. Shiritori

    ID: 9639 Type: Default 2000ms 536MiB

Shiritori

Shiritori

Problem

Here is a list of strings. Let's take a break and play with shiritori. Shiritori is performed according to the following rules.

  1. First of all, select one of your favorite strings from the list and exclude that string from the list.
  2. Next, select one character string from the list in which the last character of the previously selected character string is the first character.
  3. Exclude the selected string from the list.

After this, steps 2 and 3 will be repeated alternately.

Now, let's assume that this shiritori is continued until there are no more strings to select from the list in 2. At this time, I want to list all the characters that can be the "last character" of the last selected character string.

Constraints

The input satisfies the following conditions.

  • 1 leN lt104 1 \ le N \ lt 10 ^ 4
  • 1 lesi lt100 1 \ le | s_i | \ lt 100
  • si neqsj(i neqj) s_i \ neq s_j (i \ neq j)
  • The string contains only lowercase letters

Input

N N s1 s_1 s2 s_2 s3 s_3 :: sN s_N

The number of strings N N is given on the first line. The following N N line is given a list of strings.

Output

Output the characters that can be the "last character" of the last selected character string in ascending order from a to z in lexicographical order.

Examples

Input

5 you ate my hum toast

Output

e t u

Input

7 she sells sea shells by the seashore

Output

a e y

inputFormat

input satisfies the following conditions.

  • 1 leN lt104 1 \ le N \ lt 10 ^ 4
  • 1 lesi lt100 1 \ le | s_i | \ lt 100
  • si neqsj(i neqj) s_i \ neq s_j (i \ neq j)
  • The string contains only lowercase letters

Input

N N s1 s_1 s2 s_2 s3 s_3 :: sN s_N

The number of strings N N is given on the first line. The following N N line is given a list of strings.

outputFormat

Output

Output the characters that can be the "last character" of the last selected character string in ascending order from a to z in lexicographical order.

Examples

Input

5 you ate my hum toast

Output

e t u

Input

7 she sells sea shells by the seashore

Output

a e y

样例

5
you
ate
my
hum
toast
e

t u

</p>