#D333. Card

    ID: 270 Type: Default 4000ms 262MiB

Card

Card

Now I have a card with n numbers on it. Consider arranging some or all of these appropriately to make numbers. Find the number obtained by adding all the numbers created at this time.

For example, if you have 1 and 2, you will get 4 numbers 1, 2, 12, 21 so the total number is 36. Even if the same numbers are produced as a result of arranging them, if they are arranged differently, they are added separately. For example, if you have a card called 1 and a card called 11, there are two ways to arrange them so that they are 111, but add them as different ones. There are no leading zero cards among the cards, and we do not accept numbers that lead to zero reading. Output the answer divided by 1,000,000,007.

Input

The input is given in the form:

n a1 a2 ... an

The first line contains n (1 ≤ n ≤ 200), which represents the number of cards, and the next n lines contain the number ai (0 ≤ ai <10000) on each card. Also, the same number is never written on multiple cards.

Output

Output the sum of all the numbers you can make divided by 1,000,000,007 on one line.

Examples

Input

2 1 2

Output

36

Input

2 1 11

Output

234

Input

4 0 4 7 8

Output

135299

inputFormat

outputFormat

Output the answer divided by 1,000,000,007.

Input

The input is given in the form:

n a1 a2 ... an

The first line contains n (1 ≤ n ≤ 200), which represents the number of cards, and the next n lines contain the number ai (0 ≤ ai <10000) on each card. Also, the same number is never written on multiple cards.

Output

Output the sum of all the numbers you can make divided by 1,000,000,007 on one line.

Examples

Input

2 1 2

Output

36

Input

2 1 11

Output

234

Input

4 0 4 7 8

Output

135299

样例

2
1
2
36