Kolya loves putting gnomes at the circle table and giving them coins, and Tanya loves studying triplets of gnomes, sitting in the vertexes of an equilateral triangle.

More formally, there are 3n gnomes sitting in a circle. Each gnome can have from 1 to 3 coins. Let's number the places in the order they occur in the circle by numbers from 0 to 3n - 1, let the gnome sitting on the i-th place have a_{i} coins. If there is an integer i (0 ≤ i < n) such that a_{i} + a_{i} + n + a_{i} + 2n ≠ 6, then Tanya is satisfied. 

Count the number of ways to choose a_{i} so that Tanya is satisfied. As there can be many ways of distributing coins, print the remainder of this number modulo 10^9 + 7. Two ways, a and b, are considered distinct if there is index i (0 ≤ i < 3n), such that a_{i} ≠ b_{i} (that is, some gnome got different number of coins in these two ways).


-----Input-----

A single line contains number n (1 ≤ n ≤ 10^5) — the number of the gnomes divided by three.


-----Output-----

Print a single number — the remainder of the number of variants of distributing coins that satisfy Tanya modulo 10^9 + 7.


-----Examples-----
Input
1

Output
20
Input
2

Output
680


-----Note-----

20 ways for n = 1 (gnome with index 0 sits on the top of the triangle, gnome 1 on the right vertex, gnome 2 on the left vertex): [Image]

Difficulty: interview

Starter code:

Solutions:
n = int(input())
print((3 ** (3 * n) - 7 ** n) % 1000000007)

n=int(input())
p=3**(3*n)
#1 2 3  1 3 2  2 1 3  2 2 2  2 3 1  3 1 2  3 2 1
p-=7**n
print(p%(10**9+7))

def main():
    MOD = int(1e9 + 7)
    n = int(input())
    a = 1
    for i in range(n):
        a *= 7
        while a >= MOD: a -= MOD
    b = 1
    for i in range(3 * n):
        b *= 3
        while b >= MOD: b -= MOD
    print((b - a) % MOD)
    
main()

import sys


#sys.stdin = open("input.txt")
#sys.stdout = open("output.txt", "w")

n = int(input())

a = 1
cmod = 10 ** 9 + 7
for i in range(3*n):
	a *= 3
	a %= cmod

b = 1
for i in range(n):
	b *= 7
	b %= cmod

ans = (a-b+cmod)%cmod
print(ans)


n = int(input())
print((27 ** n - 7 ** n) % 1000000007)

n = int(input())
print(((27**n)-(7**n)) % (10**9 + 7))

        


n = int(input())

ans = (3 ** (3*n) - 7 ** n) % 1000000007

print(ans)

#import sys
#sys.stdin = open("python/in", "r")

#n, m = [int(i) for i in input().split(" ")]
n = int(input())
print( ( (27 ** n) - (7**n) ) % 1000000007)

n = int(input())
mod = 10 ** 9 + 7
print((27 ** n  - 7 ** n) % mod)


n = int(input())
res = pow(3,3*n)
res = res - pow(7,n)
res = res % (1000000000 + 7)
print(res)

n = int(input())
print((27**n - 7**n) % 1000000007)

n = int(input())
print((3 ** (3 * n) - 7 ** n) % (10 ** 9 + 7))


n = int (input())
print ((27 ** n - 7 ** n) % 1000000007)

n = int(input())
M = 10 ** 9 + 7
t1 = 0
t2 = 0
for i in range(1,4):
        for j in range(1,4):
                for k in range(1,4):
                        if i + j + k == 6:
                                t1 += 1
                        t2 += 1
a1 = 1
a2 = 1
for i in range(n):
        a1 = (a1 * t1) % M
        a2 = (a2 * t2) % M
ans = ((a2 - a1) % M + M) % M
print(ans)


n = int(input())
number_of_ways = (27**n - 7**n) % (10**9 + 7)
print(number_of_ways)

n=int(input())
a=27
b=20
for i in range(2,n+1):
    b=(1000000007+a*20+b*27-b*20)%1000000007
    a=a*27%1000000007
print(b)

n = int(input())

def solve(n):
    mod = 10 ** 9 + 7
    As = [1, 2, 3]
    ABCs = [a + b + c for a in As for b in As for c in As]
    k = len(ABCs)
    m = 20
    
    return (pow(k, n, mod) - pow(7, n, mod)) % mod

print(solve(n))

n = int(input())
print((3 ** (3 * n) - 7 ** n) % 1000000007)


B = 10**9 + 7
a = 3
def binpow(n):
    if n == 1:
        return a
    if (n & 1) == 0:
        u = binpow(n >> 1)
        return (u * u) % B
    else:
        return (binpow(n - 1) * a) % B
n = int(input())
u = binpow(n+n+n)
a = 7
v = binpow(n)
print((u + B - v) % B)