N = int(input()) keta = len(str(N)) def summation(n): return (1 + n) * n // 2 def ssummation(n, keta): base = 1 additional = 0 for i in range(keta - 1): base *= 45 if (i != 0): additional += 45 ** i return summation(n) * base + additional if (keta == 1): print(summation(N)) exit() sum = 0 for i in range(keta): sum += ssummation(int(str(N)[i]), keta - i) print(sum % 1000000007)