#include<stdio.h>
#define ll long long int
int main(){
	//printf("%d\n",sizeof(ll));
	int n;
	scanf("%d",&n);
	//ll mod=(ll)1e9+7;
	ll mod=(ll)3e9+7;
	ll x=3;
    ll y=2003094538;
	ll i;
	for(i=0;i<mod;i++){
		x*=y;
		if(x>=mod)x%=mod;
		//if(i==2345645443)printf("yes\n");
	}
	printf("0\n");
	return 0;
}