#include #include #include #include #define _USE_MATH_DEFINES #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define FOR(i,m,n) for(int i=(m);i<(n);++i) #define REP(i,n) FOR(i,0,n) #define ALL(v) (v).begin(),(v).end() const int INF = 0x3f3f3f3f, MOD = 1000000007; const long long LINF = 0x3f3f3f3f3f3f3f3fLL; /*-----------------------------------------*/ long long mod_pow(long long base, long long exponent) { long long res = 1; while (exponent > 0) { if (exponent & 1) (res *= base) %= MOD; (base *= base) %= MOD; exponent >>= 1; } return res; } pair ext_gcd(long long a, long long b) { if (b == 0) return {1, 0}; pair pr = ext_gcd(b, a % b); return {pr.second, pr.first - a / b * pr.second}; } long long mod_inv(long long a) { if (__gcd(a, (long long)MOD) != 1) return 0; pair pr = ext_gcd(a, MOD); return (pr.first + MOD) % MOD; } int main() { cin.tie(0); ios::sync_with_stdio(false); // freopen("input.txt", "r", stdin); long long n; cin >> n; long long tmp = mod_pow(10, n-1); long long ans = (tmp - 1 + MOD) % MOD * mod_inv(3) % MOD; (ans += tmp * 13 % MOD) %= MOD; cout << ans << '\n'; return 0; }