N = int(eval(input()))

mod = 10 ** 9 + 7

D = [{} for i in range(N + 1)]



def check(last4):

    for i in range(4):

        t = list(last4)

        if i >= 1:

            t[i - 1], t[i] = t[i], t[i - 1]

        if ''.join(t).count('AGC') >= 1:

            return False

    return True

    

def dfs(cur, last3):

    if last3 in D[cur]:

        return D[cur][last3]

    if cur == N:

        return 1

    res = 0

    for c in 'ACGT':

        if check(last3 + c):

            res = (res + dfs(cur + 1, last3[1:] + c)) % mod

    D[cur][last3] = res

    return res

    

print((dfs(0, '000')))
N = int(eval(input()))

mod = 10 ** 9 + 7

D = [[[[0] * 4 for i in range(4)] for i in range(4)] for i in range(101)]



D[0][3][3][3] = 1

for i in range(100):

    for j in range(4):

        for k in range(4):

            for l in range(4):

                for x in range(4):

                    if k == 0 and l == 1 and x == 2:

                        continue

                    if k == 0 and l == 2 and x == 1:

                        continue

                    if k == 1 and l == 0 and x == 2:

                        continue

                    if j == 0 and l == 1 and x == 2:

                        continue

                    if j == 0 and k == 1 and x == 2:

                        continue

                    D[i + 1][k][l][x] += D[i][j][k][l] % mod

                    D[i + 1][k][l][x] %= mod

                    

ans = 0

for j in range(4):

    for k in range(4):

        for l in range(4):

            ans += D[N][j][k][l]

            ans %= mod

                    

print(ans)
N = int(eval(input()))
mod = 10**9 + 7
D = [{} for i in range(N + 1)]


def check(last4):
    for i in range(4):
        t = list(last4)
        if i >= 1:
            t[i - 1], t[i] = t[i], t[i - 1]
        if "".join(t).count("AGC") >= 1:
            return False
    return True


def dfs(cur, last3):
    if last3 in D[cur]:
        return D[cur][last3]
    if cur == N:
        return 1
    res = 0
    for c in "ACGT":
        if check(last3 + c):
            res = (res + dfs(cur + 1, last3[1:] + c)) % mod
    D[cur][last3] = res
    return res


print((dfs(0, "000")))

N = int(eval(input()))
mod = 10**9 + 7
D = [[[[0] * 4 for i in range(4)] for i in range(4)] for i in range(101)]
D[0][3][3][3] = 1
for i in range(100):
    for j in range(4):
        for k in range(4):
            for l in range(4):
                for x in range(4):
                    if k == 0 and l == 1 and x == 2:
                        continue
                    if k == 0 and l == 2 and x == 1:
                        continue
                    if k == 1 and l == 0 and x == 2:
                        continue
                    if j == 0 and l == 1 and x == 2:
                        continue
                    if j == 0 and k == 1 and x == 2:
                        continue
                    D[i + 1][k][l][x] += D[i][j][k][l] % mod
                    D[i + 1][k][l][x] %= mod
ans = 0
for j in range(4):
    for k in range(4):
        for l in range(4):
            ans += D[N][j][k][l]
            ans %= mod
print(ans)

-D = [{} for i in range(N + 1)] - - -def check(last4): -    for i in range(4): -        t = list(last4) -        if i >= 1: -            t[i - 1], t[i] = t[i], t[i - 1] -        if "".join(t).count("AGC") >= 1: -            return False -    return True - - -def dfs(cur, last3): -    if last3 in D[cur]: -        return D[cur][last3] -    if cur == N: -        return 1 -    res = 0 -    for c in "ACGT": -        if check(last3 + c): -            res = (res + dfs(cur + 1, last3[1:] + c)) % mod -    D[cur][last3] = res -    return res - - -print((dfs(0, "000"))) +D = [[[[0] * 4 for i in range(4)] for i in range(4)] for i in range(101)] +D[0][3][3][3] = 1 +for i in range(100): +    for j in range(4): +        for k in range(4): +            for l in range(4): +                for x in range(4): +                    if k == 0 and l == 1 and x == 2: +                        continue +                    if k == 0 and l == 2 and x == 1: +                        continue +                    if k == 1 and l == 0 and x == 2: +                        continue +                    if j == 0 and l == 1 and x == 2: +                        continue +                    if j == 0 and k == 1 and x == 2: +                        continue +                    D[i + 1][k][l][x] += D[i][j][k][l] % mod +                    D[i + 1][k][l][x] %= mod +ans = 0 +for j in range(4): +    for k in range(4): +        for l in range(4): +            ans += D[N][j][k][l] +            ans %= mod +print(ans)