BETA

Difficulty Level: Hard

Submissions: 135 Accuracy:

8.15%

Hexadecimal to decimal counter
         

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.

Input:
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

Output
Print the desired output.

Constraints:
1<=T<=10

n<=2^8000 (n in decimal)

Example:
Input:

2
1F
1FF

Output:
4
8

Explanation:

For 1FF possible combinations are - 1,F,1F,F1,FF,1FF,F1F,FF1

 

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: jain_rishabh

Set Default Code

					   
It is recommended to 'Compile & Test' your code before clicking 'Submit'!

Compilation/Execution Result:

Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.