import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; import java.util.HashSet; /** * @author yangxiaozhuo * @date 2023/01/20 */ public class Main { static int mod = 998244353; static long[] dp = new long[100010]; public static void main(String[] args) throws IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String s = in.readLine(); dp[0] = 1; dp[1] = 2; int len = s.length(); // 8691461 // 9的贡献度,往前有2个数,有三次9 // 往后有90 * 4 + 900 * 6 + 9000 * 4 + 90000*1 // 自己有一个9 long res = 0; for (int i = 0; i < len; i++) { long temp = 0; //往前,前面有i个数字 假设前面有8个数,提供次数 C0 C1 C2 C3 C4 C5 C6 C7 C8 = 2^8 long mi = firstMi(i); long index = 1; int num = s.charAt(i) - '0'; int otherLen = len - i - 1; for (int j = i; j < len; j++) { temp = temp + num * index * C(otherLen, j - i); index = (index * 10) % mod; } res = (res + mi * temp) % mod; } System.out.println(res); } private static long C(int otherLen, int m) { if (m == 0) { return 1; } if (m == 1) { return otherLen; } if (otherLen - m < m) { return C(otherLen, otherLen - m); } long temp = 1; for (int i = 0; i < m; i++) { temp = temp * (otherLen - i); temp = temp / (i + 1); } return temp; } private static long firstMi(int n) { if (dp[n] != 0) { return dp[n]; } if (n % 2 == 0) { long temp = firstMi(n / 2); dp[n] = (temp * temp) % mod; } else { long temp = firstMi(n / 2); dp[n] = (temp * temp * 2) % mod; } return dp[n]; } }