Concatenation
Consider two strings α and β. Their concatenation is a string, the resulting attribution to the string α then string β. This string is denoted by αβ. For example, string concatenation 'ab' and 'ac' is the string 'abac'. It is obvious that this definition naturally extends to the concatenation of any number of rows. Thus, the concatenation of zero rows will be empty, and the concatenation of one string to itself.
Consider a set W, consisting of string. We call it the closure of the set W^{*}, consisting of those and only those strings that can be obtained by concatenating zero or more strings from the set W. Thus, the set W^{*} is an empty string, and if the string α belongs to W^{*}, and the string β belongs to W, the string αβ belongs to W^{*}. Moreover, all the elements of W^{*} can be represented in such a way that is, W^{*} is the intersection of all sets with the above properties. For example, if W={a,ab}, then W^{*} consists of all strings in which the front of each letter 'b' is at least one letter 'a'.
Given a set of strings W. Required to find a set X, such that W^{*}=X^{*} and X has the minimum possible number of elements. If several such sets, fits any of them. For example, if W={a,aabb,ab,ac,b,bac}, then the only set satisfying the conditions of the problem will be set {a,ac,b}.
Input
The input file consists of a set of strings, each of which is an element of W. Each string of the set W is found in the input file at least once. The total length of all strings in the input file does not exceed 10^4. The number of rows in the input file does not exceed 10^4. After each string of W in the input file is a line (a pair of characters with ASCII codes 13 and 10). The lines are composed of characters with ASCII codes from 33 to 126 inclusive.
Output
Derive the output file elements lexicographically minimal set X, satisfying the conditions of the problem. Each row of X must be printed only once. The lines must go to the lexicographic order (the lexicographic ordering used in dictionaries, in that order string 'ab' lower string 'aba' and string 'ab' lower string 'ac').