#include #include using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(x) (x).begin(), (x).end() #define ll long long #define INF 1000000000000000000 typedef pair pll; int main() { cin.tie(0); ios::sync_with_stdio(false); ll N; cin >> N; ll exp = 1; ll MOD = pow(10, 9) + 7; ll ans = 0; rep(i, N) { ans += exp * 3; ans %= MOD; exp *= 10; exp %= MOD; } ans += exp * 1; ans %= MOD; cout << ans << endl; }