Let us consider two strings and . Their concatenation is the string obtained by appending string to the end of string . This string is denoted as . For example, the concatenation of '' and '' is the string ''. Clearly, this definition naturally extends to the concatenation of any number of strings. Thus, the concatenation of zero strings is the empty string, and the concatenation of a single string is the string itself.
Let us consider a set consisting of strings. The closure of this set, denoted as W^{*}, is the set containing precisely those strings that can be obtained by concatenating zero or more strings from . Thus, the set W^{*} contains the empty string, and if a string belongs to W^{*} and a string belongs to , then the string belongs to W^{*}. Moreover, every element of W^{*} can be represented in this way, that is, W^{*} is the intersection of all sets with the specified properties. For example, if W=\{a, ab\}, then W^{*} consists of all strings in which before every letter '' there is at least one letter ''.
Given a set of strings , it is required to find a set such that W^{*}=X^{*} and the set contains the minimal possible number of elements. If there are several such sets, any of them will do. For example, if W=\{a, aabb, ab, ac, b, bac\}, the only set satisfying the requirements is \{a, ac, b\}.
The input file consists of a set of strings, each of which is an element of the set . Each string from appears in the input at least once. The total length of all strings in the input does not exceed 10^4. The total number of input strings does not exceed 10^4. After each string in the input file there is a line break (a pair of characters with ASCII codes and ). The strings consist of characters with ASCII codes from to inclusive.
Output to the output file the elements of the lexicographically smallest set that satisfies the requirements. Each string from must be output exactly once. The strings must be in lexicographical order (lexicographical order is the one used in dictionaries; in this order the string '' is less than '', and the string '' is less than '').
Example 1