#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define makepair make_pair
#define fir first
#define sec second
const __int128 mod = 998244353;
__int128 qpow(__int128 a, __int128 b){
__int128 res = 1;
while (b){
if (b & 1) res = res * a % mod;
a = a * a % mod;
b /= 2;
}
return res;
}
ll n;
__int128 a;
void print(__int128 a){
if (a <= 0) return;
print(a / 10);
cout << (ll)(a % 10);
}
__int128 glen(__int128 a){
__int128 res = 0;
while (a > 0){
res = res + 1;
a = a / 10;
}
return res;
}
signed main(){
ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
cin >> n;
__int128 ans = n;
a = n;
__int128 len = glen(a);
__int128 fm = (qpow(10, len) - 1 + mod) % mod;
fm = qpow(fm, mod - 2);
__int128 fz = (qpow(10, len * a) % mod - 1 + mod) % mod;
ans = ans * fz % mod * fm % mod;
print(ans);
return 0;
}