N = input() sm = [0]*10 mod = 10**9+7 for i in range(1, 10): sm[i] = i+sm[i-1] if len(N) == 1: exit(print(sm[int(N)])) res = 0 ss = 0 for i in range(len(N)): if i == 0: if int(N[0])>1: res += sm[int(N[0])-1]*int(N[i])*pow(45, len(N)-(i+1), mod) res %= mod ss = int(N[0]) else: res += pow(45, len(N)-i, mod) res %= mod if int(N[i])>1: res += ss*sm[int(N[i])-1]*pow(45, len(N)-(i+1), mod) res %= mod ss *= int(N[i]) ss %= mod res += ss print(res%mod)