N = input() l = list(map(int,list(N))) P = 10 ** 9 + 7 dp = [0] * len(l) now = l[0] for i in range(l[0]): dp[0] += i for i in range(len(l)-1): dp[i+1] = dp[i] * 45 % P for j in range(l[i+1]): dp[i+1] += now * j for j in range(10): dp[i+1] += j now = now * l[i+1] % P print((dp[-1]+now)%P)