P=998244353 D=E=F=0 for c in input():c=int(c);D,E,F=(D*9+E+F*c+(1-F)*(c>8))%P,(E*10+c)%P,(F+(1-F)*(c==8))%P print((D+F)%P)