You are given a string s consisting of digits from 0 to 9(both inclusive). You can insert ‘+’ between any two characters of the string (maybe none). The resultant string has to be a valid mathematical expression.
Numbers having leading zeros are considered valid.

Example: Consider the string 406 : “406+,4++06,+406” etc. are not valid mathematical expressions.
Whereas “4+06,40+6,4+0+6,406” are valid.

You need to evaluate all the valid mathematical expressions and print the sum of all results.

Input Format:
- First line of input contains an integer T, the number of test cases.
- T lines follow, each containing a string S, containing only numeric characters.

Output Format:
Output contains

T lines each having the answer corresponding to each test case.

Constraints:
1 ≤

T ≤ 10

1 ≤

| S | ≤ 10, where

| S | denotes length of string

Sample Input:
1

406

Sample Output:
472

Explanation:
All the valid mathematical expressions are as follows:

4+0+6=10

40+6=46

4+06=10

406=406

Final Answer is 406+10+46+10 = 472