Harryxun/stf_run huggingface dataset:
def step(n, memo={}):
    if n <= 1:
        return 1
    elif n == 2:
        return 2
    elif n in memo:
        return memo[n]%1000000007
    else:
        memo[n] = step(n-1,memo)+step(n-2,memo)
        return memo[n]%1000000007

N, M = map(int, input().split())
a = [-1]

for m in range(M):
    a.append(int(input()))
    if a[m+1] - a[m] == 1:
        print(0)
        break
else:
    a.append(N+1)
    ans = 1
    for m in range(M+1):
        ans = (ans*step(a[m+1]-a[m]-2))%1000000007
    print(ans)

### FIXED CODE ###

import sys
sys.setrecursionlimit(1000000)

def step(n, memo={}):
    if n <= 1:
        return 1
    elif n == 2:
        return 2
    elif n in memo:
        return memo[n]
    else:
        memo[n] = (step(n-1,memo)+step(n-2,memo))%1000000007
        return memo[n]

N, M = map(int, input().split())
a = [-1]

if M == 0:
    print(step(N))

else:
    for m in range(M):
        a.append(int(input()))
        if a[m+1] - a[m] == 1:
            print(0)
            break
    else:
        a.append(N+1)
        ans = 1
        for m in range(M+1):
            ans = (ans*(step(a[m+1]-a[m]-2)))%1000000007
        print(ans)
import sys
sys.setrecursionlimit(10**7)

def modinv(a,m=10**9+7):
    if a==0: return 1
    b=m
    (x, lastx) = (0, 1)
    (y, lasty) = (1, 0)
    while b != 0:
        q = a // b
        (a, b) = (b, a % b)
        (x, lastx) = (lastx - q * x, x)
        (y, lasty) = (lasty - q * y, y)
    return lastx % m

def cur(p):
    for x in neighbor[p]:
        if x==par[p]: x.remove(neighbor[p])
        par[x]=p
        descend[p]+=cur(x)
    return descend[p]

def cur2(p):
    for x in neighbor[p]:
        ans[x]=ans[p]*descend[x]*modinv(n-descend[x])%mod
        cur2(x)

mod=10**9+7
n=int(input())
neighbor=[[]  for _ in range(n+1)]
descend=[1]*(n+1)
par=[0]*(n+1)

for _ in range(n-1):
    a,b=map(int,input().split())
    neighbor[a].append(b)
    neighbor[b].append(a)
cur(1)

ans=[1]*(n+1)
ans1=1
for i in range(1,n+1):
    ans1=ans1*i*modinv(descend[i])%mod
ans[1]=ans1
cur2(1)
for i in range(1,n+1):
    print(ans[i])


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)

def modinv(a,m=10**9+7):
    if a==0: return 1
    else:
        b=m
        (x, lastx) = (0, 1)
        (y, lasty) = (1, 0)
        while b != 0:
            q = a // b
            (a, b) = (b, a % b)
            (x, lastx) = (lastx - q * x, x)
            (y, lasty) = (lasty - q * y, y)
        return lastx % m

def cur(p):
    if neighbor[p]==[]: return
    for x in neighbor[p]:
        par[x]=p
        neighbor[x].remove(p)
        cur(x)
    descend[par[p]]+=descend[p]

def cur2(p):
    for x in neighbor[p]:
        ans[x]=ans[p]*descend[x]*modinv(n-descend[x])
        ans[x]%=mod
        cur2(x)

mod=10**9+7
n=int(input())
neighbor=[set()  for _ in range(n+2)]
descend=[1 for i in range(n+1)]
par=[0]+[0]*(n+1)

for _ in range(n-1):
    a,b=map(int,input().split())
    neighbor[a].add(b)
    neighbor[b].add(a)

cur(1)


ans=[1]*(n+1)
ans1=1
for i in range(1,n+1):
    ans1=ans1*i*modinv(descend[i])
    ans1%=mod
ans[1]=ans1

cur2(1)

for i in range(1,n+1):
    print(ans[i])
def dist(arr, n):
	res = 0; su = 0
	for i in range(n):
		res = (res + (arr[i] * i) - su) % mod
		su = (su + arr[i]) % mod

	return res % mod

n,m,k = map(int,input().split())
mod = int(1e9+7)
fact = [1]
for i in range(1,int(1e5)+1):
	fact.append((fact[-1] * i)%mod)

x = []
y = []

for i in range(1,n+1):
	for j in range(1,m+1):
		x.append(i)
		y.append(j)

y.sort()

tot = (dist(x,n*m) + dist(y,n*m))%mod
N = n*m - 2
Need = k-2
num = fact[N]
den = (fact[Need] * fact[N-Need])%mod
ncr = (num * pow(den,mod-2,mod)) % mod
ans = (tot * ncr) % mod
print(ans)

### FIXED CODE ###

def dist(arr, n):
	res = 0; su = 0
	for i in range(n):
		res = (res + (arr[i] * i) - su) % mod
		su = (su + arr[i]) % mod

	return res % mod

n,m,k = map(int,input().split())
mod = int(1e9+7)
fact = [1]
for i in range(1,n*m+1):
	fact.append((fact[-1] * i)%mod)

x = []
y = []

for i in range(1,n+1):
	for j in range(1,m+1):
		x.append(i)
		y.append(j)

y.sort()

tot = (dist(x,n*m) + dist(y,n*m))%mod
N = n*m - 2
Need = k-2
num = fact[N]
den = (fact[Need] * fact[N-Need])%mod
ncr = (num * pow(den,mod-2,mod)) % mod
ans = (tot * ncr) % mod
print(ans)
def main():
    n, k = map(int, input().split())
    h = tuple(map(int, input().split()))

    if k >= n:
        print(abs(h[-1]-h[0]))

    dp = [0]*(n)

    for i in range(1, n):
        temp = 10**10
        for j in range(1, min(i, k)+1):
            temp = min(temp, dp[i-j]+abs(h[i]-h[i-j]))
        dp[i] = temp

    print(dp[-1])

if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    n = int(input())
    h = [int(i) for i in input().split()]
    cost = [0 for _ in range(n)]
    cost[0] = 0
    cost[1] = abs(h[1] - h[0])
    for i in range(2, n):
        cost[i] = min(cost[i-1]+abs(h[i] - h[i-1]), cost[i-2]+abs(h[i] - h[i-2]))
    print(cost[-1])
main()
from collections import deque


def bfs(sy, sx, gy, gx):
    # yが下方向，xが右方向
    d = [[float("inf")] * w for _ in range(h)]

    dy = [0, 1, 0, -1]
    dx = [1, 0, -1, 0]

    que = deque([])
    que.append((sy, sx))
    d[sy][sx] = 0

    while que:

        p = que.popleft()

        if p[0] == gy and p[1] == gx:
            break

        for i in range(4):
            ny = p[0] + dy[i]
            nx = p[1] + dx[i]

            if 0 <= ny < h and 0 <= nx < w and maze[ny][nx] != "#" and d[ny][nx] == float("inf"):
                que.append((ny, nx))
                d[ny][nx] = d[p[0]][p[1]] + 1
 
    if d[gy][gx] == float("inf"):
        return -1
    else:
        return [gy][gx]


h, w = map(int, input().split())
maze = [list(input()) for _ in range(h)]

res = 0
for y in range(h):
    for x in range(w):
        if maze[y][x] == '#':
            res += 1

dis = bfs(0, 0, h - 1, w - 1)

if dis == -1:
    print(-1)
else:
    print(h * w - res - dis - 1)


### FIXED CODE ###

from collections import deque


def bfs(sy, sx, gy, gx):
    # yが下方向，xが右方向
    d = [[float("inf")] * w for _ in range(h)]

    dy = [0, 1, 0, -1]
    dx = [1, 0, -1, 0]

    que = deque([])
    que.append((sy, sx))
    d[sy][sx] = 0

    while que:

        p = que.popleft()

        if p[0] == gy and p[1] == gx:
            break

        for i in range(4):
            ny = p[0] + dy[i]
            nx = p[1] + dx[i]

            if 0 <= ny < h and 0 <= nx < w and maze[ny][nx] != "#" and d[ny][nx] == float("inf"):
                que.append((ny, nx))
                d[ny][nx] = d[p[0]][p[1]] + 1

    if d[gy][gx] == float("inf"):
        return -1
    else:
        return d[gy][gx]


h, w = map(int, input().split())
maze = [list(input()) for _ in range(h)]

res = 0
for y in range(h):
    for x in range(w):
        if maze[y][x] == '#':
            res += 1

dis = bfs(0, 0, h - 1, w - 1)

if dis == -1:
    print(-1)
else:
    print(h * w - res - dis - 1)
k = 0
int n = int(input())
for i in range(n):
  if i % 3 != 0 and i % 5 != 0:
    k += i

print(k)

### FIXED CODE ###

k = 0
n = int(input())
for i in range(n+1):
  if i % 3 != 0 and i % 5 != 0:
    k += i
 
print(k)
import sys
from copy import copy
lines = sys.stdin.readlines()
ds = tuple([int(i) for i in lines[1].split(' ')])
#print(ds)

cache = dict()
def move(ds):
    if len(ds) == 1:
        return 0

    d = 0
    for i in range(len(ds) -1 ):
        nds = list(ds)
        d += nds[i+1] - nds[i]
        nds.pop(i)
        nds = tuple(nds)
        if nds in cache:
            d += cache[nds]
        else:
            t = move(nds)
            cache[nds] = t
            d += t
    #print(d, ds)
    return d / (len(ds) - 1)

r = move(ds)
#print(r)
for i in range( len(ds)-1):
    #print(i+1)
    r *= (i + 1)
r = r % (pow(10,9)+7)
print(int(r))


### FIXED CODE ###

import sys
from itertools import count, accumulate
from operator import mul
from functools import reduce
lines = sys.stdin.readlines()

positions = [int(i) for i in lines[1].split(' ')]

distances = [ j - i for i, j in zip(positions, positions[1:])]

n = len(distances)
p = pow(10,9) + 7

factorials = [1] + list(accumulate(range(1,n + 1), lambda x, y: (x * y) % p))

combinations = dict()
def combination(i, j):
    j = min(j, i - j)
    if (i, j) in combinations:
        return combinations((i, j))
    else:
        return factorials[i] // (factorials [j] * factorials[i - j])

permutations = dict()
def permutation(i, j):
    if (i, j) in permutations:
        return permutations((i, j))
    else:
        return reduce(mul, range(j, i+1))

def modpow(a, n, mod):
    res = 1
    while n > 0:
        if n & 1:
            res = res * a % mod
        a = a * a % mod
        n = n >> 1
    return res

s = 0
result = 0
for d, i in zip(distances, count(1)):
    lt = i - 1
    gt = n - i
    i_inv = modpow(i, p-2, p)
    t = factorials[n] * i_inv
    s += t
    result += d * s

print(int(result % (pow(10,9) + 7)))
a,b = map(int, input())
if len(str(a)) == 1 and len(str(b)) == 1:
  print(a*b)
else:
  print(-1)

### FIXED CODE ###

a,b = map(int, input().split())
if len(str(a)) == 1 and len(str(b)) == 1:
  print(a*b)
else:
  print(-1)
def soma(a):
    res=0
    for i in range(0, len(a)):
        res+=int(a[i])

    if(res>=10):
        return soma(str(res))

    return res

def main():
    n = int(input())
    menor = soma("1")+soma(str(n-1))
    
    for i in range(1,10):
        if(soma(str(i))+soma(str(n-i))<menor):
            menor = soma(str(i))+soma(str(n-i))

    print(menor)
    
main()


### FIXED CODE ###

n=int(raw_input())
ret=[]
for y in range(n/2):
	a=y+1
	b=n-a
	r1 = 0
	r2 = 0
	for i in str(a):
		r1 += int(i)
	for x in str(b):
		r2 += int(x)
	r=r1+r2
	ret.append(r)
print min(ret)
s=input()[::-1]
ans=0
u=0
d=1
l=[0]*2019
l[0]=1
for i in map(int,s):
  u=u+(i*d)%2019
  l[u]+=1
  d=d*10%2019
for i in l:
  ans+=i*(i-1)//2
print(ans)


### FIXED CODE ###

s=input()[::-1]
ans=0
u=0
d=1
l=[0]*2019
l[0]=1
for i in map(int,s):
  u=(u+i*d)%2019
  l[u]+=1
  d=d*10%2019
for i in l:
  ans+=i*(i-1)//2
print(ans)
n, m = map(int, input().split())
h = list(map(int, input().split()))
ans = 0
list1 = [1] * (n)
for i in range(m):
    a, b = map(int, input().split())
    if h[a - 1] > h[b - 1]:
        list1[a - 1] = 0
    if h[a - 1] < h[b - 1]::
        list1[b - 1] = 0
print(sum(list1))

### FIXED CODE ###

N, M = map(int, input().split())
H = [0] + list(map(int, input().split()))
O = [0] + [1] * N
for _ in range(M):
    A, B = map(int, input().split())
    if H[A] <= H[B]:
        O[A] = 0
    if H[A] >= H[B]:
        O[B] = 0
print(sum(O))
n=int(input())
print(n**2)
#B
n=int(input())
s=list(str(input()))
if n % 2 ==0:
    ans=0
    for i in range(n//2):
        if s[i]==s[n//2+i]:
            ans+=1
        else:
            ans+=0

    if ans==n//2:
        print('Yes')
    else:
        print('No')   

else:
    print('No')

### FIXED CODE ###

n=int(input())
s=list(str(input()))
if n % 2 ==0:
    ans=0
    for i in range(n//2):
        if s[i]==s[n//2+i]:
            ans+=1
        else:
            ans+=0

    if ans==n//2:
        print('Yes')
    else:
        print('No')   

else:
    print('No')
# -*- coding: utf-8 -*-
A, B, M = map(int,  input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
sum = [0.0] * (A * B)

for i in range(M):
        x, y, c = map(int,  input().split())
        sum[(y-1)*A + (x-1)] -= c

for ia in range(A):
        for ib in range(B):
                sum[ib*A + ia] += a[ia] + b[ib]

sum.sort()

i=0
while sum[i] < 0:
        i+=0
print(sum[i])


### FIXED CODE ###

# -*- coding: utf-8 -*-
A, B, M = map(int,  input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))

sum = []
for i in range(M):
        x, y, c = map(int,  input().split())
        sum.append(a[x-1]  + b[y-1] - c)

a.sort()
b.sort()

sum.append(a[0] + b [0])

sum.sort()

i=0
while sum[i] < 0:
        i+=0
print(sum[i])
a=list(map(int,input().split())).sort()
if a==[5,5,7]:
  print(YES)
  else:
    print(NO)
    
    

### FIXED CODE ###

a=list(map(int,input().split()))
a.sort() 
if a==[5,5,7]:
  print("YES")
else:
    print("NO")
import math
import sympy

def combi(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def kai(n):
    return math.factorial(n)

N, M = map(int, input().split() )

prime = sympy.factorint(M)

ans = 1
for v in prime.values():
    ans  =  ans * (kai(N+v-1)/(kai(v)*kai(N-1)))

ans = ans % (10**9 + 7)
ans = int(ans)
print(ans)

### FIXED CODE ###

import math

def prime_factor2(n):
    i = 2
    factors = {}
    while i * i <= n:
        if n % i:
            i += 1
        else:
            n //= i
            if i in factors:
                factors[i] += 1
            else:
                factors[i] = 1
    if n > 1:
        if n in factors:
            factors[n] += 1
        else:
            factors[n] = 1
    return factors

def kai(n):
    return math.factorial(n)

def H(n, r):
    rtn = 1
    for i in range(n+r-1, n-1, -1):
        rtn *= i
    rtn //= kai(r)
    return rtn


N, M = map(int, input().split())

prime = prime_factor2(M)

ans = 1
for v in prime.values():
    h = H(N, v) % (10**9 + 7)
    ans  =  ans * h

ans = ans % (10**9 + 7)
ans = int(ans)
print(ans)
n, m = [int(i) for i in input().split()]
sc = [list(map(int, input().split())) for _ in range(m)]


ans = -1
for i in range(10**(n-1), 10**n):
    for s, c in sc:
        if str(i)[s-1] != str(c):
            break
    else:
        ans = i
        break
if n == 1:
    if m == 0 or set(sc) == {[1, 0]}:
        ans = 0
print(ans)


### FIXED CODE ###

n, m = [int(i) for i in input().split()]
sc = [list(map(int, input().split())) for _ in range(m)]


ans = -1
for i in range(10**(n-1) if n > 1 else 0, 10**n):
    for s, c in sc:
        if str(i)[s-1] != str(c):
            break
    else:
        ans = i
        break
print(ans)
n,q = map(int,input().split())
s = list(input())
lis = [0]*(len(s))

for i in range(len(s)-1):
  if s[i]+s[i+1] == 'AC':
    lis[i],lis[i+1] = 0.5,0.5
    

for j in range(q):
  l,r = map(int,input().split())
  su = sum(lis[l-1:r])
  if lis[l-1] == 0.5 and lis[l-2] == 0.5 and lis[r-1] == 0.5 and lis[r]==0.5:
    su -= 1
  print(int(su))

### FIXED CODE ###

#累積和的な

n,q = map(int,input().split())
s = input() + 'A' 
li = [0]*(n+1)

for i in range(n):
  li[i+1] = li[i] + (1 if s[i] + s[i+1] == 'AC' else 0)
  

for j in range(q):
  l,r = map(int,input().split())
  print(li[r-1] - li[l-1])
a = int(raw_input())
b = int(raw_input())
c = int(raw_input())
x = int(raw_input())

def dfs(x, i, m, v):
  	if x < 0: return 0
  	if x == 0: return 1
  	if i == 2: return 1 if x % 50 else 0  	
  	r = 0
  	for k in range(0, m[i] + 1):
  		r += dfs(x - k * v[i], i+1, m,v)
  	return r
m,v = {0:a,1:b,2:c}, {0:500,1:100,2:50}
print dfs(x,0,m,v)


### FIXED CODE ###

n,mat = raw_input(),[ map(int,raw_input().split()) for i in range(2)]
def f(mat,i,j):
	if i<0 or j <0:
		return -float('inf')
	if i == 0 and j == 0:
		return mat[i][j] 
	return mat[i][j] + max(f(mat,i-1,j),f(mat,i,j-1))
print f(mat,1,len(mat[0])-1)
a, b = map(int, input().split)
if (a*b) % 2 == 0 :
  print("Even")
else:
  print("Odd")

### FIXED CODE ###

a, b = map(int, input().split())
if (a*b) % 2 == 1:
    print("Odd")
else:
    print("Even")
re = open("input")
count = 0
role = {".": True, "@": False, "#": False}
def now(xpoint, ypoint):
    return role[room[ypoint][xpoint]]

def search(xpoint, ypoint):
    global count
    if 0 <= xpoint < wh[0] and 0 <= ypoint < wh[1] and now(xpoint, ypoint):
        count += 1
        room[ypoint][xpoint] = "@"
        search(xpoint - 1, ypoint)
        search(xpoint + 1, ypoint)
        search(xpoint, ypoint + 1)
        search(xpoint, ypoint - 1)

while True:
    wh = map(int, re.readline().split())
    room = []
    count = 0
    for ypoint in range(wh[1]):
        line = re.readline().replace("\n", "")
        if "@" in line:
            xp = line.index("@")
            yp = ypoint
        room.append([x for x in line])
    if not room: break
    room[yp][xp] = "."
    search(xp, yp)
    print count

### FIXED CODE ###

(lambda f:f(f))(lambda T,A=lambda L,yp,ri=lambda l:R.append([{xi:x}for xi,x in enumerate(l)]):[P.__setitem__("x",L.index("@")),P.__setitem__("y",yp),ri(L)]if "@"in L else ri(L),S=lambda X,Y,s,u:[R[Y][X].__setitem__(X,"@"),s(X-1,Y,s,u)+s(X+1,Y,s,u)+s(X,Y+1,s,u)+s(X,Y-1,s,u)+1][1]if 0<=X<W[0]and 0<=Y<W[1]and u(X,Y)else 0,u=lambda X,Y:R[Y][X].get(X)is ".",g=globals:[g().__setitem__("W",list(map(int,input().split()))),g().__setitem__("R",[]),g().__setitem__("P",{"x":9,"y":9}),[A(input(),Y)for Y in range(W[1])],[R[P["y"]][P["x"]].__setitem__(P["x"],"."),print(S(P["x"],P["y"],S,u)),T(T)]if R else 9])
# -*- coding:utf-8 -*-

def solve():
    r = input()
    print(r*r)

if __name__ == "__main__":
    solve()


### FIXED CODE ###

# -*- coding:utf-8 -*-

def solve():
    r = int(input())
    print(r*r)


if __name__ == "__main__":
    solve()
import math

lst = []
min_1 = "129"
for i in range(5):
    s = input()
    lst.append(s)
    if s[-1] != "0" and s[-1] <= min_1[-1]:
        min_1 = s
lst.remove(min_1)
a = list(map(lambda x:math.ceil(int(x)/10)*10,lst))
print(sum(a) + int(min_1))


### FIXED CODE ###

just=[]
left=[]
for i in range(5):
  a=int(input())
  if a%10 == 0:
    just.append(a)
  else:
    left.append(a)
_sum = sum(just)    
_min=10
index=-1
for i in range(len(left)):
  i1=left[i]%10
  if _min > i1:
    _min = i1
    index = i
for i in range(len(left)):
  if i == index:
    _sum += left[i]
  else:
    b=left[i]%10
    _sum += left[i] + (10-b)
print(_sum)
O = input()
E = input()

ans = ''
for i in range(len(O)+len(E)):
    if i%2==0:
        ans = ans+O[i]
    else:
        ans = ans+E[i//2]
print(ans)

### FIXED CODE ###

O = input()
E = input()

ans = ''

if len(O)==len(E):
    for i in range(len(O)):
        ans=ans+O[i]
        ans=ans+E[i]
else:
    for i in range(len(O)-1):
        ans=ans+O[i]
        ans=ans+E[i]
    ans=ans+O[len(O)-1]


print(ans)
import sys
stdin = sys.stdin
sys.setrecursionlimit(10**6)
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

k = ni()
s = ns()
n = len(s)
mod = 10**9+7


def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

N = 10**3*3
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )

ans = 0
for i in range(k+1):
    ans += cmb(n-1+i,i,mod)*pow(25,i,mod)%mod*pow(26,k-i,mod)%mod
    ans %= mod

print(ans)

### FIXED CODE ###

import sys
stdin = sys.stdin
sys.setrecursionlimit(10**6)
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

k = ni()
s = ns()
n = len(s)
mod = 10**9+7


def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

N = 10**6*3
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )

ans = 0
for i in range(k+1):
    ans += cmb(n-1+i,i,mod)*pow(25,i,mod)%mod*pow(26,k-i,mod)%mod
    ans %= mod

print(ans)
b=input()
if b="A":
  print("T")
elif b="T":
  print("A")
elif b="G":
  print("C")
else:
  print("G")
       

### FIXED CODE ###

b=input()
if b=="A":
  print("T")
elif b=="T":
  print("A")
elif b=="G":
  print("C")
else:
  print("G")
N = int(input())

aaa = list(map(int, input().split()))



ans = 1

for i in range(N):
    if ans > 10 ** 18:
    print(-1)
    else:
        ans = ans * aaa[i]
print(ans)








### FIXED CODE ###


N = int(input())

aaa = list(map(int, input().split()))
ans = 1

if 0 in aaa:
    ans = 0
else:
    for i in range(N):
        if ans > 10 ** 18:
            ans = -1
            break
        else:
            ans = ans * aaa[i]


if ans > 10 ** 18:
    ans = -1


print(ans)
r = int(input())
pi = 3.14159265358979
print("{:.6f} {:.6f}".format(r**2*pi, 2*r*pi))



### FIXED CODE ###

import math
r = float(input())
pi = math.pi
print("{} {}".format(r*r*pi, 2*r*pi))
r1, c1, r2, c2 = map(int, input().split())
MOD = 10**9+7

def init_mod_c(lim=10**6*2, mod=10**9+7):
    fact = [1, 1] + [0] * (lim-1)
    fact_inv = [1, 1] + [0] * (lim-1)
    inv = [0, 1] + [0] * (lim-1)
    
    for i in range(2, lim+1):
        fact[i] = fact[i - 1] * i % mod
        inv[i] = mod - inv[mod % i] * (mod//i) % mod
        fact_inv[i] = fact_inv[i - 1] * inv[i] % mod

    def mod_c(n, m):
        if n < m or n < 0 or m < 0: return 0
        return fact[n] * (fact_inv[m] * fact_inv[n-m] % mod) % mod

    return mod_c

comb = init_mod_c()
pc = lambda r, c: comb(r+c, min(r, c))

ans = 0
for i in range(r1, r2+1):
    ans += pc(i+1, c2)
    if c1 > 0: ans -= pc(i+1, c1-1)
    ans %= MOD

print(ans)

### FIXED CODE ###

r1, c1, r2, c2 = map(int, input().split())
MOD = 10**9+7

def init_mod_c(lim=10**7, mod=10**9+7):
    fact = [1, 1] + [0] * (lim-1)
    fact_inv = [1, 1] + [0] * (lim-1)
    inv = [0, 1] + [0] * (lim-1)
    
    for i in range(2, lim+1):
        fact[i] = fact[i - 1] * i % mod
        inv[i] = mod - inv[mod % i] * (mod//i) % mod
        fact_inv[i] = fact_inv[i - 1] * inv[i] % mod

    def mod_c(n, m):
        if n < m or n < 0 or m < 0: return 0
        return fact[n] * (fact_inv[m] * fact_inv[n-m] % mod) % mod

    return mod_c

comb = init_mod_c()
pc = lambda r, c: comb(r+c, min(r, c))

ans = 0
for i in range(r1, r2+1):
    ans += pc(i+1, c2)
    if c1 > 0: ans -= pc(i+1, c1-1)
    ans %= MOD

print(ans)
list = []
N = int(input())
for i in range(N):
  S, P = map(str, input().split())
  list.append((i+1, S, int(P)))
list = sorted(lst, key=lambda x:(x[1], -x[2]))
 
for l in list:
  print(l[0])

### FIXED CODE ###

list = []
N = int(input())
for i in range(N):
  S, P = map(str, input().split())
  list.append((i+1, S, int(P)))
list = sorted(list, key=lambda x:(x[1], -x[2]))
 
for l in list:
  print(l[0])
a , b=map(int , input() , split() )
if(a*b)%2:
    print("0dd")
else:
    print("Even")


### FIXED CODE ###

a, b = map(int, input().split())
if (a*b) % 2:
    print("Odd")
else:
    print("Even")
import numpy as np
X = int(input())

t = np.arange(-100000, 100000, 1)
t = t**5
S = set(t)

for B in range(-100000, 100001, 1):
    if X+B**5 in S:
        print("%d %d"%((X+B**5)**0.2, B))
        break


### FIXED CODE ###

import numpy as np
X = int(input())

t = np.arange(0, 2000001, 1)
t = t**5
S = set(t)

for B in range(0,200001,1):
    if X+B**5 in S:
        print("%d %d"%((X+B**5)**0.2, B))
        break
    if X-B**5 in S:
        print("%d %d"%((X-B**5)**0.2, -B))
        break
a,b,c,d = map(int,input().split())
ans = min(b,　d) - max(a,　c)
if ans < 0:
    print(0)
else:
    print(ans)

### FIXED CODE ###

a,b,c,d = map(int,input().split())
ans = min(b,d) - max(a,c)
if ans < 0:
    print(0)
else:
    print(ans)
N=int(input("N:"))
a,b=map(int,input().split())
Num=0
Num_sum=0

for number in range(1,N+1):
    for num in str(number):
        num=int(num)
        Num+=num

    if Num>=a and Num<=b:
        Num_sum+=number
    Num=0
print(Num_sum)

### FIXED CODE ###

N,a,b=map(int,input().split())
Num=0
Num_sum=0

for number in range(1,N+1):
    for num in str(number):
        num=int(num)
        Num+=num

    if Num>=a and Num<=b:
        Num_sum+=number
    Num=0
print(Num_sum)