#define _USE_MATH_DEFINES #include using namespace std; const long long mod = 1e9 + 7; long long power(long long x, long long y) { long long res = 1; while (y) { if (y & 1) res = res * x % mod; x *= x; res %= mod; x %= mod; y >>= 1; } return res; } long long sub(long long x, long long y) { long long res = x - y; if (x < 0) x += mod; return res; } long long inverse(long long x) { x = (x % mod + mod) % mod; long long y = mod, u = 1, v = 0; while(y) { long long t = x / y; x -= t * y; swap(x, y); u -= t * v; swap(u, v); } return (u % mod + mod) % mod; } signed main() { ios::sync_with_stdio(false); cin.tie(0); long long n; cin >> n; cout << sub(4 * power(10, n) % mod, 1) * inverse(3) % mod << endl; return 0; }