As we all know Barney's job is "PLEASE" and he has not much to do at work. That's why he started playing "cups and key". In this game there are three identical cups arranged in a line from left to right. Initially key to Barney's heart is under the middle cup. [Image] 

Then at one turn Barney swaps the cup in the middle with any of other two cups randomly (he choses each with equal probability), so the chosen cup becomes the middle one. Game lasts n turns and Barney independently choses a cup to swap with the middle one within each turn, and the key always remains in the cup it was at the start.

After n-th turn Barney asks a girl to guess which cup contains the key. The girl points to the middle one but Barney was distracted while making turns and doesn't know if the key is under the middle cup. That's why he asked you to tell him the probability that girl guessed right.

Number n of game turns can be extremely large, that's why Barney did not give it to you. Instead he gave you an array a_1, a_2, ..., a_{k} such that  $n = \prod_{i = 1}^{k} a_{i}$ 

in other words, n is multiplication of all elements of the given array.

Because of precision difficulties, Barney asked you to tell him the answer as an irreducible fraction. In other words you need to find it as a fraction p / q such that $\operatorname{gcd}(p, q) = 1$, where $gcd$ is the greatest common divisor. Since p and q can be extremely large, you only need to find the remainders of dividing each of them by 10^9 + 7.

Please note that we want $gcd$ of p and q to be 1, not $gcd$ of their remainders after dividing by 10^9 + 7.


-----Input-----

The first line of input contains a single integer k (1 ≤ k ≤ 10^5) — the number of elements in array Barney gave you.

The second line contains k integers a_1, a_2, ..., a_{k} (1 ≤ a_{i} ≤ 10^18) — the elements of the array.


-----Output-----

In the only line of output print a single string x / y where x is the remainder of dividing p by 10^9 + 7 and y is the remainder of dividing q by 10^9 + 7.


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

Output
1/2

Input
3
1 1 1

Output
0/1

Difficulty: competition

Starter code:

Solutions:
3

class Matrix:
    def __init__(self, n, m, arr=None):
        self.n = n
        self.m = m
        self.arr = [[0] * m for i in range(n)]
        if arr is not None:
            for i in range(n):
                for j in range(m):
                    self.arr[i][j] = arr[i][j]

    def __mul__(self, other):
        assert self.m == other.n
        ans = Matrix(self.n, other.m)
        for i in range(self.n):
            for j in range(other.m):
                for k in range(self.m):
                    ans.arr[i][j] = (ans.arr[i][j] + self.arr[i][k] * other.arr[k][j]) % (10 ** 9 + 7)
        return ans

    def __imul__(self, other):
        self = self * other
        return self

    def __pow__(self, n):
        if n == 0:
            ans = Matrix(self.n, self.n)
            for i in range(self.n):
                ans.arr[i][i] = 1
            return ans
        elif n & 1 == 1:
            return self * (self ** (n - 1))
        else:
            t = self ** (n >> 1)
            return t * t

    def __ipow__(self, n):
        self = self ** n
        return self

    def __eq__(self, other):
        if self.n != other.n or self.m != other.m:
            return False
        for i in range(self.n):
            for j in range(self.m):
                if self.arr[i][j] != other.arr[i][j]:
                    return False
        return True


def fpow(a, n):
    if n == 0:
        return 1
    elif n & 1 == 1:
        return (a * fpow(a, n - 1)) % (10 ** 9 + 7)
    else:
        t = fpow(a, n >> 1)
        return (t * t) % (10 ** 9 + 7)


transform = Matrix(2, 2, [[1, 1], [0, 4]])
mtx = transform

k = int(input())
a = list(map(int, input().split()))
"""
f = False
for j in a:
    if j % 2 == 0:
        f = True
        break
if f:
    print(a)
    tp = 1
    for j in a:
        if f and j % 2 == 0:
            j //= 2
            f = False
        print(j)
        mtx **= j
    ans = Matrix(2, 1, [[0], [1]])
    ans = mtx * ans
    print(ans.arr)
    print("%d/%d" % (ans.arr[0][0], ans.arr[1][0]))
"""

x = 1
for j in a:
    x = (x * j) % (10 ** 9 + 6)

x = (x - 1) % (10 ** 9 + 6)

if x % 2 == 0:
    ans = (transform ** (x // 2)) * Matrix(2, 1, [[0], [1]])
    print("%d/%d" % (ans.arr[0][0], fpow(2, x)))
else:
    y = (x - 1) % (10 ** 9 + 6)
    ans = (transform ** (y // 2)) * Matrix(2, 1, [[0], [1]])
    print("%d/%d" % ((ans.arr[0][0] * 2 + 1) % (10 ** 9 + 7), (ans.arr[1][0] * 2) % (10 ** 9 + 7)))
    


mod = 1000000007
_ = input()
numbers = list(map(int,input().split()))
b = 2
flag = 1 if len(list([x for x in numbers if x%2 == 0])) else -1
for num in numbers:
    b = pow(b,num,mod)

b = b*pow(2,mod-2,mod)%mod # b = 2^n-1
a = (b+flag)*pow(3,mod-2,mod)%mod #a = (2^n-1 -/+ 1) / 3
print("%d/%d"%(a,b))



from functools import reduce
mod = 1000000007
n = input()
numbers = list(map(int,input().split()))
flag = 1 if len(list([x for x in numbers if x%2 == 0])) else -1
b = reduce(lambda x,y:pow(x,y,mod),numbers,2)
b = b*pow(2,mod-2,mod)%mod # b = 2^n-1
a = (b+flag)*pow(3,mod-2,mod)%mod #a = (2^n-1 -/+ 1) / 3
print("%d/%d"%(a,b))



from functools import reduce
mod = 1000000007
n = input()
num = list(map(int,input().split()))
flag = 1 if len(list([x for x in num if x%2 == 0])) else -1
b = reduce(lambda x,y:pow(x,y,mod),num,2)
b = b*pow(2,mod-2,mod)%mod # b = 2^n-1
a = (b+flag)*pow(3,mod-2,mod)%mod #a = (2^n-1 -/+ 1) / 3
print("%d/%d"%(a,b))



from functools import reduce
mod = 1000000007
n = input()
num = list(map(int,input().split()))
flag = 1 if len(list([x for x in num if x%2 == 0])) else -1
b = reduce(lambda x,y:pow(x,y,mod),num,2)
b = b*pow(2,mod-2,mod)%mod
a = (b+flag)*pow(3,mod-2,mod)%mod
print("%d/%d"%(a,b))




k = int(input())
n = list(map(int, input().split()))

for i in range(k):
    n[i] = bin(n[i])
    n[i] = n[i][2:]
    
magic = 1000000007

def par(s):
    if s[-1] == '0':
        return True
    else:
        return False

def mod_pow(x, s, p):
    ans = 1
    for i in range(len(s)):
        if s[i] == '1':
            ans = (((ans * ans) % p) * x) % p
        else:
            ans = (ans * ans) % p
    return ans

def div_in_field(a, b, p):
    b_op = pow(b, p - 2, p)
    return (b_op * a) % p


denominator = 2
n_par = False
for i in range(len(n)):
    denominator = mod_pow(denominator, n[i], magic)
    if par(n[i]):
        n_par = True

denominator = div_in_field(denominator, 2, magic)
numerator = 0
if n_par:
    numerator = div_in_field(1 + denominator, 3, magic)
else:
    numerator = div_in_field(-1 + denominator, 3, magic)
ans = str(numerator) + '/' + str(denominator)
print(ans)


from functools import reduce
mod = 1000000007
n = input()
num = list(map(int,input().split()))
flag = 1 if len(list([x for x in num if x%2 == 0])) else -1
b = reduce(lambda x,y:pow(x,y,mod),num,2)
b = b*pow(2,mod-2,mod)%mod
a = (b+flag)*pow(3,mod-2,mod)%mod
print("%d/%d"%(a,b))


class Matrix:
    def __init__(self, n, m, arr=None):
        self.n = n
        self.m = m
        self.arr = [[0] * m for i in range(n)]
        if arr is not None:
            for i in range(n):
                for j in range(m):
                    self.arr[i][j] = arr[i][j]
    def __mul__(self, other):
        assert self.m == other.n
        ans = Matrix(self.n, other.m)
        for i in range(self.n):
            for j in range(other.m):
                for k in range(self.m):
                    ans.arr[i][j] = (ans.arr[i][j] + self.arr[i][k] * other.arr[k][j]) % (10 ** 9 + 7)
        return ans
    def __imul__(self, other):
        self = self * other
        return self
    def __pow__(self, n):
        if n == 0:
            ans = Matrix(self.n, self.n)
            for i in range(self.n):
                ans.arr[i][i] = 1
            return ans
        elif n & 1 == 1:
            return self * (self ** (n - 1))
        else:
            t = self ** (n >> 1)
            return t * t
    def __ipow__(self, n):
        self = self ** n
        return self
    def __eq__(self, other):
        if self.n != other.n or self.m != other.m:
            return False
        for i in range(self.n):
            for j in range(self.m):
                if self.arr[i][j] != other.arr[i][j]:
                    return False
        return True
def fpow(a, n):
    if n == 0:
        return 1
    elif n & 1 == 1:
        return (a * fpow(a, n - 1)) % (10 ** 9 + 7)
    else:
        t = fpow(a, n >> 1)
        return (t * t) % (10 ** 9 + 7)
transform = Matrix(2, 2, [[1, 1], [0, 4]])
mtx = transform
k = int(input())
a = list(map(int, input().split()))
x = 1
for j in a:
    x = (x * j) % (10 ** 9 + 6)
x = (x - 1) % (10 ** 9 + 6)
if x % 2 == 0:
    ans = (transform ** (x // 2)) * Matrix(2, 1, [[0], [1]])
    print("%d/%d" % (ans.arr[0][0], fpow(2, x)))
else:
    y = (x - 1) % (10 ** 9 + 6)
    ans = (transform ** (y // 2)) * Matrix(2, 1, [[0], [1]])
    print("%d/%d" % ((ans.arr[0][0] * 2 + 1) % (10 ** 9 + 7), (ans.arr[1][0] * 2) % (10 ** 9 + 7)))


from functools import reduce
mod = 1000000007
n = input()
num = list(map(int,input().split()))
flag = 1 if len(list([x for x in num if x%2 == 0])) else -1
b = reduce(lambda x,y:pow(x,y,mod),num,2)
b = b*pow(2,mod-2,mod)%mod # b = 2^n-1
a = (b+flag)*pow(3,mod-2,mod)%mod #a = (2^n-1 -/+ 1) / 3
print("%d/%d"%(a,b))


from functools import reduce
mod = 1000000007
n = input()
num = list(map(int,input().split()))
flag = 1 if len(list([x for x in num if x%2 == 0])) else -1
b = reduce(lambda x,y:pow(x,y,mod),num,2)
b = b*pow(2,mod-2,mod)%mod 
a = (b+flag)*pow(3,mod-2,mod)%mod 
print("%d/%d"%(a,b))


mod = 1000000007
input()
numbers = list(map(int, input().split()))
b = 2
flag = 1 if len(list(filter(lambda x : x % 2 == 0, numbers))) else -1
for num in numbers:
    b = pow(b, num, mod)
b = b * pow(2, mod - 2, mod) % mod
a = (b + flag) * pow(3, mod - 2, mod) % mod
print("%d/%d"%(a, b))

m = 1000000007
input()
n, d = 2, 1
for q in map(int, input().split()): d, n = q & d, pow(n, q, m)
n = n * pow(2, m - 2, m) % m
k = (n + 1 - 2 * d) * pow(3, m - 2, m) % m
print(str(k) + '/' + str(n))

from functools import reduce
MOD = 10 ** 9 + 7
n, a = int(input()), map(int, input().split())
n = reduce(lambda x,y:(x*y)%(MOD-1), a, 1)
# 333333336 * 3 = 1
# 500000004 * 2 = 1
k = n % 2
q = (pow(2, n, MOD) * 500000004) % MOD
if k == 0:
 p = ((q + 1) * 333333336) % MOD
else:
 p = ((q - 1) * 333333336) % MOD
print("%d/%d" % (p, q))

k = int(input())

MOD = 10 ** 9 + 7

antithree = pow(3, MOD - 2, MOD)

antitwo = pow(2, MOD - 2, MOD)

power = 1

parity = False

for t in map(int, input().split()):

    power *= t

    power %= MOD - 1

    if t % 2 == 0:

        parity = True

q = pow(2, power, MOD) * antitwo

q %= MOD

if parity:

    p = (q + 1) * antithree

    p %= MOD

else:

    p = (q - 1) * antithree

    p %= MOD    

print(p, q, sep = '/')



# Made By Mostafa_Khaled

from functools import reduce
mod = 1000000007
n = input()
num = list(map(int,input().split()))
flag = 1 if len(list(filter(lambda x: x%2 == 0,num))) else -1
b = reduce(lambda x,y:pow(x,y,mod),num,2)
b = b*pow(2,mod-2,mod)%mod # b = 2^n-1
a = (b+flag)*pow(3,mod-2,mod)%mod #a = (2^n-1 -/+ 1) / 3
print("%d/%d"%(a,b))

mod = int(1e9+7)

k = int(input())
top = 1
yoink = 1
a = list(map(int, input().split()))
for thing in a:
    top *= thing 
    yoink *= thing
    yoink %= 2
    top %= (mod-1)

def extended_gcd(aa, bb):
    lastremainder, remainder = abs(aa), abs(bb)
    x, lastx, y, lasty = 0, 1, 1, 0
    while remainder:
        lastremainder, (quotient, remainder) = remainder, divmod(lastremainder, remainder)
        x, lastx = lastx - quotient*x, x
        y, lasty = lasty - quotient*y, y
    return lastremainder, lastx * (-1 if aa < 0 else 1), lasty * (-1 if bb < 0 else 1)

def modinv(a, m):
	g, x, y = extended_gcd(a, m)
	if g != 1:
		raise ValueError
	return x % m


if top == 0:
    bot = modinv(2, mod) 
else:
    bot = pow(2, top-1, mod) 
#print(bot)

# odd case
if yoink % 2 == 0:
    blah = modinv(3, mod)
    blah *= (bot+1)
    blah %= mod
    print(str(blah) + '/' + str(bot))
else:
    blah = modinv(3, mod)
    blah *= (bot+2)
    blah %= mod
    print(str(blah-1) + '/' + str(bot))