This problem is about "AC".
One day, I write a long string S on the paper which contains "A" and "C". Now I want to find a lexicographic minimum string T satisfied that T is distinct with all substring of S.
The first line of input file contains an integer T indicating the number of case.
In each test case:
Input a string S consist of "A" and "C". The length of S is not large than 100.
For each test case:
You should output the string T meet the condition.
No tag edit access