import math def keisan(maru): aaa = 5**(maru-1) * 4 return aaa num = int( raw_input() ) #print num if num % 2 == 1: a = num / 2 b = keisan(a) b = b * 3 else: a = num / 2 b = keisan(a) kai = b % 1000000007 print kai