#pragma GCC optimize("Ofast,unroll-loops") #include #include #include using namespace std; constexpr unsigned md = 998244353; int main() { cin.tie(nullptr), ios::sync_with_stdio(false); string S; cin >> S; const int N = S.size(); using ull = unsigned long long; vector A(N); ull pow2 = 1; for (int i = 0; i < N; i++) { A[i] = (S[i] - '0') * pow2 % md; pow2 += pow2; if (pow2 >= md) pow2 -= md; } ull pow11 = 1; for (int i = 0; i < N; i++) { A[N - 1 - i] = (A[N - 1 - i] * pow11) % md; pow11 = pow11 * 11 % md; } ull ret = 0; for (int i = 0; i < N; i++) ret += A[i]; cout << ret % md << '\n'; }