the-game-bw-parimal-vkc

Parimal and VKC are playing a game. The scenerio is that  'N' balls are there in front of Parimal and VKC, also each ball has been given number from 0 to 9, but there is an exception for the first ball which has been given number from 1 to 9. VKC being a MathsLover calculates all the substrings of the number thus formed, one by one. If the sub-string is 'X' then Parimal has to throw 'X' candies into an initially empty box. At the end of the game, Parimal has to find out the total number of cadbaries (TOTAL )in the box. As TOTAL can be large, VKC asks Parimal to tell TOTAL % (10^9+7) instead. If Parimal answers correctly, he can keep all the cadbaries . Parimal is not so good in Maths as VKC and hence ask for your Help!

Input Format 
A single line containing a string of numbers that appear on the first, second, third ball and so on.

Output Format 
A single line which is the number of cadbaries in the box, TOTAL % (10^9+7)

Constraints 
1 ≤ N ≤ 2*105

SAMPLE INPUT
16

SAMPLE OUTPUT
23

Explanation

input testcase will produce substrings 16, 1 and 6.
output would be 23

Source: hackerearth | Difficulty: MEDIUM


Solutions: