#define _CRT_SECURE_NO_WARNINGS
#pragma comment(linker, "/stack:16777216")
#include <string>
#include <vector>
#include <map>
#include <list>
#include <iterator>
#include <set>
#include <queue>
#include <iostream>
#include <sstream>
#include <stack>
#include <deque>
#include <cmath>
#include <memory.h>
#include <cstdlib>
#include <cstdio>
#include <cctype>
#include <algorithm>
#include <utility>
#include <time.h>
#include <bitset>
#include <random>
using namespace std;
#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
#define RFOR(i, b, a) for(int i = (b) - 1; i >= (a); --i)
#define ITER(it, a) for (__typeof(a.begin()) it = a.begin(); it != a.end(); it++)
#define FILL(A,value) memset(A,value,sizeof(A))
#define ALL(V) V.begin(), V.end()
#define SZ(V) (int)V.size()
#define PB push_back
#define MP make_pair
const double PI=acos(-1.0);
typedef long long Int;
typedef long long LL;
typedef unsigned long long UINT;
typedef vector <int> VI;
typedef pair <int, int> PII;
typedef pair <double, double> PDD;
const int INF = 1000 * 1000 * 1000 + 7;
const LL LINF = INF * (LL) INF;
const int MAX = 1024;
const int MAXK = 51;
const int MAX2 = 24000000;
const int LEN = 21;
const int BASE = 1000000000;
const int MOD = 998244353;
int a[MAX];
int R[MAX][MAX];
Int Pow(Int a, Int b)
{
Int res = 1;
a %= MOD;
while (b > 0)
if (b % 2 == 0)
{
b /= 2;
a = a * a % MOD;
}
else
{
-- b;
res = res * a % MOD;
}
return res;
}
int main()
{
string s;
cin >> s;
stringstream ss;
ss << s;
Int n;
ss >> n;
Int r = 1;
FOR (i,0,SZ(s)) r = r * 10 % MOD;
Int w = (1 - Pow(r, n) + MOD) % MOD * Pow((1 - r % MOD + MOD) % MOD, MOD-2) % MOD;
Int res = 0;
FOR (i,0,SZ(s))
{
Int d = s[i]-'0';
FOR (j,0,SZ(s)-i-1) d = d * 10 % MOD;
res = (res + d * w) % MOD;
}
cout << res << endl;
return 0;
}