#!/usr/bin/python # -*- Coding: utf-8 -*- mod = 1000000007 n = 10**18 n = int(input()) m = n//2 if n == 1: print(2) elif n % 2 == 0: print((pow(5,m-1,mod)*4)%mod) else: print((pow(5,m-1,mod)*4*3)%mod)