N = int(input()) L = list(str(N)) L = [int(x) for x in L] #print(L) M = len(str(N)) MOD = pow(10,9)+7 A = 45 ans = 0 for i in range(1,M): ans += pow(A,i,MOD) exact = 1 for i in range(M): keta = M - i shita = (L[i]-1)*L[i]//2 #print(shita,keta) if i != M-1: ans += exact*shita* pow(A,keta-1,MOD) exact = exact*L[i]%MOD else: exact = exact*(1+L[i])*L[i]//2%MOD #print(ans,exact) ans += exact print(ans%MOD)