#!/usr/bin/python2 # -*- coding: utf-8 -*- # † mod = 10 ** 9 + 7 def f(n): if n == 1: return 2 k = n / 2 - 1 res = pow(5, k, mod) * 4 res %= mod if n & 1: res *= 3 res %= mod return res n = int(raw_input()) res = f(n) print res