In this problem, you are given a sequence of words (lowercase letters). Find the longest chain of words w_1, \ldots, w_n such that w_i is a mixed extension of w_{i-1}. A word is a mixed extension of if can be formed by adding exactly one letter to the letters of and then permuting the result. For example, "", "", "", "", and "" form a chain of length .
Each test case contains at least and at most lines, each containing a single word. The length of each word is at least and at most . All words in the input are distinct.
Output the longest chain that can be formed from the given words. Print each word in the chain starting from the first one. If there are multiple longest chains, output any of them.
Example 1