#include using namespace std; typedef long long ll; int mod = 1e9+7; int main(){ int N; cin >> N; vector val(N+1,0); val[0] = 1; for(int i=1; i<=N; i++){ val[0] = (val[0]*10)%mod; } val[1] = 3; for(int i=2; i<=N; i++){ val[i] = (val[i-1]*10)%mod; } ll ans = 0; for(int i=0; i<=N; i++){ ans += val[i]; ans = ans%mod; } cout << ans << endl; }