You are given a number n in hexadecimal. A new number can be made from the number n by selecting any subsequence of it (in HexaDecimal) and rearranging it.
You have tell the number of distinct numbers that can be made from number n.
Since the answer will be very large, output the answer as modulo 10^9+7.
First Line Consist of T - number of test cases. Only line of the test case contains a single line containing the input number in hexadecimal
Print the desired output.
n<=2^8000 (n in decimal)
For 1FF possible combinations are - 1,F,1F,F1,FF,1FF,F1F,FF1
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.