SP1031 UPSUB - Up Subsequence
Description
If x = a $ _{0} $ a $ _{1} $ a $ _{2} $ ...a $ _{n-1} $ is a string where a $ _{i} $ denotes the character at index i, a subsequence a $ _{j0} $ a $ _{j1} $ a $ _{j2} $ ...a $ _{jn} $ is called an upsubsequence if a $ _{j0} $
Input Format
The first line of the input contains an integer **t**, the number of test cases. **t** test cases follow.
Each test case consists of a single line containing a string **x**, where the length of **x** is no more than 100. **x** will not contain any spaces, tabs or other whitespace characters.
Output Format
For each test csae, output all of the maximal upsubsequences of **x** in lexicographical order. Print a blank line after each test case.