from itertools import accumulate m = 1000000007 N = input() lut = list(accumulate(range(10))) result = lut[int(N[-1])] b = 45 for c in map(int, N[:-1][::-1]): if c != 0: result = c * result + lut[c - 1] * b + b result %= m b *= 45 b %= m print(result)