//当出现大数时,考虑数学
//本题用到经典的花间,(先考虑暴力做法)把暴力求和的内容其出来化简
//注意取模,每一步都取模,防止溢出
#include <iostream>
using namespace std;
typedef unsigned long long ull;
const ull mod = 998244353;
ull qmi(ull a, ull b)
{
ull res = 1 % mod;
while (b)
{
if (b & 1) res = res * a % mod;
a = a * (ull)a % mod;
b >>= 1;
}
return res;
}
int main()
{
ull N;
ull d=1;
cin>>N;
while(d<=N) d*=10;
d%=mod;
cout<<N%mod*(qmi(d,N)-1)%mod*qmi(d-1,mod-2)%mod;
}