n = int(input()) if n <= 4: d = [(3, 0), (3, 2), (2, 3), (0, 3), (-2, 3), (-3, 2), (-3, 0), (-3, -2), (-2, -3), (0, -3), (2, -3), (3, -2)] from itertools import product s = set() for p in product(d, repeat=n): x = sum(dx for dx, dy in p) y = sum(dy for dx, dy in p) s.add((x, y)) print(len(s)) exit() ans = (5 * n + 1) ** 2 - 4 * (2 * n + 1) * n print(ans % (10 ** 9 + 7))