#include using namespace std; typedef signed long long ll; #define _P(...) (void)printf(__VA_ARGS__) #define FOR(x,to) for(x=0;x<(to);x++) #define FORR(x,arr) for(auto& x:arr) #define FORR2(x,y,arr) for(auto& [x,y]:arr) #define ALL(a) (a.begin()),(a.end()) #define ZERO(a) memset(a,0,sizeof(a)) #define MINUS(a) memset(a,0xff,sizeof(a)) template bool chmax(T &a, const T &b) { if(a bool chmin(T &a, const T &b) { if(a>b){a=b;return 1;}return 0;} //------------------------------------------------------- string N; pair dp[1010101][2]; const ll mo=998244353; pair dfs(int d,int le) { if(d<0) return {1,0}; if(dp[d][le].first>=0) return dp[d][le]; ll no8=0,yes8=0; int i; FOR(i,10) { if(le==0&&i>N[d]-'0') continue; auto p=dfs(d-1,le||(i>N; reverse(ALL(N)); MINUS(dp); auto p=dfs(N.size()-1,0); cout<