#!/usr/bin/env python3 mod = 10 ** 9 + 7 n = int(input()) result = 1 if n == 1: result *= 2 # 1, 8 else: if n % 2 == 1: result *= 3 # 1, 8, 0 result *= 4 # 1, 8, 6, 9 result *= pow(5, n // 2 - 1, mod) # 1, 8, 0, 6, 9 print(result % mod)