#include int main() { using ll = long long; const int MOD = 998244353; ll n; std::cin >> n; ll r = 0; ll len = 1; for (ll i = 1; i <= n; i++) { ll d = 1; while (d <= i) d *= 10; d %= MOD; r = ((r * d + i) % MOD * len + r) % MOD; len = len * d % MOD * len % MOD; } std::cout << r << "\n"; return 0; }