"""

寄与を考える

二乗なら簡単だが…





"""

import sys
from sys import stdin

lsum = 1

S = list(map(int,list(stdin.readline()[:-1])))

S.reverse()
N = len(S)


ans = 0
mod = 998244353

for i in range(N):

    ans += lsum * S[i] * pow(2,N-1-i,mod)
    ans %= mod

    lsum += lsum * 10
    lsum %= mod

print (ans)