#include using namespace std; typedef long long ll; typedef unsigned long long ull; #define REP(i, n) for(int i=0; ibool chmax(T &a, const T &b) { if (abool chmin(T &a, const T &b) { if (b> N; DP[0][0][0] = 1; REP(i,N+1){ //int n = S[i] - '0'; int n = (i == 0); for(int last = 0; last < 10; last++){ for(int s = 0; s < 2; s++){ for(int j = 0; j < 10; j++){ int nl = -1, ns = -1; if(!s && j > n) continue; if(j < n) ns = 1; else ns = s; if(j < last) continue; nl = j; DP[i+1][nl][ns] += DP[i][last][s]; DP[i+1][nl][ns] %= MOD; } } } } ll ans = 0; for(int last = 0; last < 10; last++){ for(int s = 0; s < 2; s++){ ans += DP[N+1][last][s]; ans %= MOD; } } cout << ans << endl; return 0; }