You are given a number. You want to compute the sum of all possible resulting numbers after applying the magic operation.
In a magic operation, you pick a non-empty subsequence from this number, then take these digits out of the number. The remaining digits then fill in the gap, and the number after the magic operation is the integer that is left.
For eg: Let's say the number is \(12345\). One of the subsequences of this number is \(24\). So after removing this subsequence, the resulting number is \(135\).
Leading zeros are allowed in the resulting number (number after applying the magic operation). When all digits are removed, the number is considered to be \(0\).
Input Format:
- The first line contains one integer \(T\) \(-\) the number of test cases. Then \(T\) test cases follow.
- The first and only line of each test case contains a single integer \(N\).
Output Format:
For each test case output in a seperate line\(:\)
The sum of all possible resulting numbers after applying the magic operation modulo \((10^9 + 7)\).
Constraints:
- \(1 \leq T \leq 10^5\)
- \(1 \leq N \leq 10^{100000}\)
- It is guaranteed that sum of \(N\) over all test cases doesn't exceed \(10^{100000}\).