#include using i64 = long long; template T pow(T x, T n, T mod) { T ret = 1; while(n > 0) { if ((n & 1) == 1) ret = (ret * x) % mod; x = (x * x) % mod; n >>= 1; } return ret; } template T inverse(T x, T p) { return pow(x, p - 2, p); } int main() { constexpr i64 mod = 1000000007; constexpr i64 inv3 = 333333336; i64 n; std::cin >> n; std::cout << (pow(10ll, n - 1, mod) * (inv3 + 13ll) + mod - inv3) % mod << std::endl; return 0; }