#include const int INF = 1e9; const int MOD = 1e9 + 7; const long long LINF = 1e18; #define dump(x) cout << 'x' << ' = ' << (x) << ` `; #define FOR(i, a, b) for(int i = (a); i < (b); ++i) #define rep(i, n) for(int i = 0; i < (n); ++i) #define REPR(i, n) for(int i = n; i >= 0; i--) #define FOREACH(x, a) for(auto &(x) : (a)) typedef long long ll; using namespace std; typedef pair P; template class modint { using u64 = std::uint_fast64_t; public: u64 a; constexpr modint(const u64 x = 0) noexcept : a(x % Modulus) {} constexpr u64 &value() noexcept { return a; } constexpr const u64 &value() const noexcept { return a; } constexpr modint operator+(const modint rhs) const noexcept { return modint(*this) += rhs; } constexpr modint operator-(const modint rhs) const noexcept { return modint(*this) -= rhs; } constexpr modint operator*(const modint rhs) const noexcept { return modint(*this) *= rhs; } constexpr modint operator/(const modint rhs) const noexcept { return modint(*this) /= rhs; } constexpr modint &operator+=(const modint rhs) noexcept { a += rhs.a; if(a >= Modulus) { a -= Modulus; } return *this; } constexpr modint &operator-=(const modint rhs) noexcept { if(a < rhs.a) { a += Modulus; } a -= rhs.a; return *this; } constexpr modint &operator*=(const modint rhs) noexcept { a = a * rhs.a % Modulus; return *this; } constexpr modint &operator/=(modint rhs) noexcept { u64 exp = Modulus - 2; while(exp) { if(exp % 2) { *this *= rhs; } rhs *= rhs; exp /= 2; } return *this; } }; using mint = modint; constexpr int M = 1145141; mint dp[M][2][10]; int main(int argc, char const *argv[]) { int a; cin>>a; string s = "1"; rep(i,a) s.push_back('0'); int n = s.length(); rep(i,M) rep(j,2) rep(k,10) dp[i][j][k] = 0; dp[0][0][0] = 1; rep(i,n) { int D = (int)(s[i]-'0'); rep(j,2) { for (int x = 0; x <= (j?9:D); ++x) { rep(k,10) { if (x < k) continue; dp[i+1][j||(x