#include "bits/stdc++.h" using namespace std; const int MOD = 1e9+7; void solve() { long N; cin>> N; int ans = 1; while(N--) { ans *= 10; ans += 3; ans %= MOD; } cout << ans<< endl; } int main(void) { solve(); //cout << "yui(*-v・)yui" << endl; return 0; }