#include<bits/stdc++.h>
using namespace std;
int dp[1000010][4];
const int mod=1e9+7;
int main(){
	int n; cin>>n;
	dp[0][0]=1;
	for(int i=1;i<=n;++i){
		for(int j=0;j<4;++j){
			(dp[i][j]+=dp[i-1][j]*8ll%mod)%=mod;
			(dp[i][j|1]+=dp[i-1][j])%=mod;
			(dp[i][j|2]+=dp[i-1][j])%=mod;
		}
	}
	printf("%d\n",dp[n][3]);	
} 