It was Sherlock’s Birthday. On his birthday he received a letter, with no sender’s information except “MISS ME?” scribbled over the cover. On opening the letter he found that the letter is ciphered and contains T lines (strings), each of some length L. In order to decipher the message he want to determine the number of different strings he can generate using the alphabets of a given string.
Help Sherlock find answer to this puzzle.
Hint: He can't use a single element of the string multiple times.
INPUT
The first line of the input contains an integer T denoting the number of test cases. The description of T test cases follows.
For each test case there is a single line contain the string S of lower case alphabets only.
OUTPUT
CONSTRAINTS
1 ≤ T ≤ 1000
1 ≤ |S| < 20
Example case 1. Possible new strings are (aab),(aba) and (baa)
Example case 2. Possible new strings are (abc),(acb),(bac),(bca),(cab) and (cba)