Harryxun/stf_run huggingface dataset:
list = [int(input()) for n in range(5)]
min = 100
for i in range(5):
  if min > list[i] % 10 and list[i] % 10 != 0:
    min = list[i] % 10
    min_arg = i
ans = 0
for i in range(5):
  if i == min_arg:
    continue
  ans += list[i]
  if ans % 10 != 0:
    ans = ans - (ans % 10) + 10
ans += list[min_arg]
print(ans)

### FIXED CODE ###

list = [int(input()) for n in range(5)]
min = 100
min_arg = 0
for i in range(5):
  if min > list[i] % 10 and list[i] % 10 != 0:
    min = list[i] % 10
    min_arg = i
ans = 0
for i in range(5):
  if i == min_arg:
    continue
  ans += list[i]
  if ans % 10 != 0:
    ans = ans - (ans % 10) + 10
ans += list[min_arg]
print(ans)
# -*- coding: utf-8 -*-
import sys
# ----------------------------------------------------------------
# Use Solve Function

def solve(lines):
    A,B = map(int, lines.pop(0).split(' '))
    print(max( A+B, A-B, A*B ))

#
# main
#

# 1. use list instead of stdin

#contents = '''\
#3 -4\
#'''
lines = contents.split('\n')

# 2. use stdin

lines = [x.strip() for x in sys.stdin.readlines()]

#
# solve !!
#
solve(lines)

### FIXED CODE ###

# -*- coding: utf-8 -*-
import sys
# ----------------------------------------------------------------
# Use Solve Function

def solve(lines):
    A,B = map(int, lines.pop(0).split(' '))
    print(max( A+B, A-B, A*B ))

#
# main
#

# 1. use list instead of stdin

#contents = '''\
#3 -4\
#'''
#lines = contents.split('\n')

# 2. use stdin

lines = [x.strip() for x in sys.stdin.readlines()]

#
# solve !!
#
solve(lines)
S=input()
x,y=map(int,input().split())
import itertools
Xmove=[]
Ymove=[]
Xbase=0
Ybase=0
Xtar=True
for key,g in itertools.groupby(S):
  num=len(list(g))
  if key=="T":
    if num%2==1:
      Xtar^=True
  else:
    if Xtar:
      Xmove.append(num)
      Xbase+=num
    else:
      Ymove.append(num)
      Ybase+=num
if Xbase<x or Ybase<y:
  print("No")
  exit(0)

dpX=[[False for i in range(Xbase*2+1)] for j in range(2)]
dpY=[[False for i in range(Ybase*2+1)] for j in range(2)]
Xind=0

if S[0]=="F":
  dpX[0][Xbase+Xmove[0]]=True
  Xind=1
else:
  dpX[0][Xbase]=True
dpY[0][Ybase]=True

cur=0
for i in range(Xind,len(Xmove)):
  for j in range(len(dpX[cur])):
    if dpX[cur][j]:
      dpX[1-cur][j+Xmove[i]]=True
      dpX[1-cur][j-Xmove[i]]=True
      dpX[cur][j]=False
  cur=1-cur
  
if not dpX[cur][x+Xbase]:
  print("No")
  exit(0)
  
cur=0
for i in range(len(Ymove)):
  for j in range(len(dpY[cur])):
    if dpY[cur][j]:
      dpY[1-cur][j+Ymove[i]]=True
      dpY[1-cur][j-Ymove[i]]=True
      dpY[cur][j]=False
  cur=1-cur
  
if dpY[cur][y+Ybase]:
  print("Yes")
else:
  print("No")


### FIXED CODE ###

S = input()
X,Y = map(int,input().split())

# [文字,その文字が連続する数]
from collections import deque
sumS = deque()
import itertools
for key,g in itertools.groupby(S):
  sumS.append([key,len(list(g))])
  
startx = 0 # Fで始まる場合はX軸の正の方向にあらかじめ進めて置く
# 最初のTが出るまではX軸正の方向に進む
if sumS[0][0] == "F":
  startx = sumS[0][1]
  sumS.popleft()

xdir = True # X軸方向を向いている
dpXcur = set()
dpXcur.add(startx)
dpYcur = set()
dpYcur.add(0) # Y軸は必ず0から始まる
dpXnex = set()
dpYnex = set()
for i in range(len(sumS)):
  if sumS[i][0] == "F":
    steps = sumS[i][1] # 進む数
    if xdir: # X軸方向を向いている場合
      for x in dpXcur:
        dpXnex.add(x + steps)
        dpXnex.add(x - steps)
      dpXcur = dpXnex
      dpXnex = set()
    else:
      for y in dpYcur:
        dpYnex.add(y + steps)
        dpYnex.add(y - steps)
      dpYcur = dpYnex
      dpYnex = set()
  elif sumS[i][0] == "T":
    turns = sumS[i][1] # 方向転換する数
    if turns % 2 == 1:
      # 奇数回の場合はX/Y軸の切り替え (偶数回の場合は何も起こらない)
      xdir ^= True
      
if X in dpXcur and Y in dpYcur:
  print("Yes")
else:
  print("No")
num = int(a)*int(b)
if num % 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')
from sklearn.datasets import load_digits
input, ground_truth = load_digits(return_X_y=True)
 
l = input().split()
 
a = int(l[0],16)
b = int(l[1],16)
 
if a == b:
	print("=")
elif a < b:
	print("<")
else:
	print(">")

### FIXED CODE ###

l = input().split()

a = int(l[0],16)
b = int(l[1],16)

if a == b:
	print("=")
elif a < b:
	print("<")
else:
	print(">")
def main():
    a, b, c = map(int,input().split())

    b / a = count
    if count < c :
        print(count)
    else:
        print(c)

if __name__ == '__main__'
    main()

### FIXED CODE ###

def main():
    a, b, c = map(int,input().split())

    count = int(b / a)
    if count < c :
        print(count)
    else:
        print(c)

if __name__ == '__main__':
    main()
A = int(input())
B = int(input())
C = 1
delta = 0.00000001
while( C < B ):
  if C*A % B < delta:
    break
  C+=1
  
print(C*A)

### FIXED CODE ###

A,B = [int(s) for s in input().split()]

C = 1
delta = 0.00000001
while( C < B ):
  if C*A % B < delta:
    break
  C+=1
  
print(C*A)
n, k = map(int,input().split())
MOD = 10**9 + 7

from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

for i in range(k):
    ans = 0
    ans += cmb(n-k+1,i+1)*cmb(k-1,i)
    ans %= MOD
    print(ans)

### FIXED CODE ###

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

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

mod = 10**9+7 #出力の制限
N = 10**4
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 )


for i in range(k):
    print(cmb(n-k+1,i+1,mod)*cmb(k-1,i,mod)%mod)
N = int(input())
H = list(map(int, input().split()))

above = H[N-1]
for i in range(N-2, -1, -1):
    cur = H[i]
    #print(cur, above)
    if cur <= above:
        above = cur
        continue
    elif cur - 1 == above:
        continue
    else:
        break

if i == 0:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

N = int(input())
H = list(map(int, input().split()))

if N == 1:
    print("Yes")
else:
    for i in range(N-1, 0, -1):
        #print(H[i-1], H[i])
        if H[i-1] <= H[i]:
            #print("@")
            continue
        elif (H[i-1] - 1) == H[i]:
            #print("#")
            H[i-1] = H[i]
        else:
            #print("=")
            break
    
    if i == 1:
        print("Yes")
    else:
        print("No")
x=int(input())
cost=100
while(cost<x):
    cost*=101
    cost=//100
    ans+=1
print(ans)

### FIXED CODE ###

x=int(input())
ans=0
cost=100
while(cost<x):
    cost=cost*101//100
    ans+=1
print(ans)
n=int(input())
readints = lambda: map(int,input().split(' '))
a=list(readints())
a.sort()
mid = n//2
x=a[mid]
y=a[mid+1]
print(y-x)


### FIXED CODE ###

n=int(input())
readints = lambda: map(int,input().split(' '))
a=list(readints())
a.sort()
mid = n//2
x=a[mid-1]
y=a[mid]
print(y-x)
a = int(input())
b = int(input())
print(a*b)

### FIXED CODE ###

a,b = map(int,input().split())
print(a*b)
N,Y=map(int,input().split())
answer=[]

try:
 for i in range(N+1):
   for j in range(N-i+1):
     sum=i*10000+j*5000+(N-i-j)*1000
     if sum==Y:
       raise Exception
except Exception:
  answer=[i,j,N-i-j]
  print(answer)
else:
  print[-1,-1,-1]

### FIXED CODE ###

N,Y=map(int,input().split())
answer=[]

try:
 for i in range(N+1):
   for j in range(N-i+1):
     sum=i*10000+j*5000+(N-i-j)*1000
     if sum==Y:
       raise Exception
except Exception:
  print(i,j,N-i-j)
else:
  print(-1,-1,-1)
n = inr(input())
s= input()
if n<=:
  print("red")
else:
  print(s)

### FIXED CODE ###

n = int(input())
s= input()
if n<3200:
  print("red")
else:
  print(s)
a = input.split()
print(a[1] + a[0])

### FIXED CODE ###

a = input().split()
print(a[1] + a[0])
S=input()
max_count=0
for i in range(len(S)):
  if S[i] in [A,C,G,T]:
    j=0
    while S[i+j] in [A,C,G,T]:
      max_count=max(max_count,j)
      j+=1
      if i+j==len(S):
        break
print(max_count)

### FIXED CODE ###

S=input()
max_count=0
for i in range(len(S)):
    if S[i] in ['A','C','G','T']:
        j=0
        while S[i+j] in ['A','C','G','T']:
            max_count=max(max_count,j+1)
            j+=1
            if i+j==len(S):
                break
print(max_count)
N,K=input().split()
N,K=[int(N),int(K)]
 
minimum=0
while True:
  minimum=N
  if minimum > = N:
    minimum=N
  else:
    minimum=minimum
    break
  
  
print(minimum)

### FIXED CODE ###

N,K=input().split()
N,K=[int(N),int(K)]

minimum=N%K
while N%K>K-N%K:
    minimum=K-N%K
    N=K-N%K
print(minimum)
n, q = list(map(int, input().split()))
cnt = [0 for _ in range(n + 1)]
cnt[0] = -1
mx = [0, -1]


def spam():
#    max_v = max(cnt)
#    idx = min([i for i, value in enumerate(cnt) if value == max_v])
#    return idx, max_v
    return 1,1

for _ in range(q):
    a, v = list(map(int, input().split()))
    cnt[a] += v
    if mx[0] == a and v > 0:
        mx[1] += v
    elif mx[0] == a and v < 0:

        mx = spam()

    if cnt[a] > mx[1]:
        print("%d %d" % (a, cnt[a]))
        mx[0], mx[1] = a, cnt[a]
    else:
        print("%d %d" % (mx[0], mx[1]))

### FIXED CODE ###

n, q = list(map(int, input().split()))
cnt = [0 for _ in range(n + 1)]
cnt[0] = -9999999999
mx = [0, cnt[0]]


def spam():
    max_v = max(cnt)
    idx = min([i for i, value in enumerate(cnt) if value == max_v])
    return idx, max_v

for _ in range(q):
    a, v = list(map(int, input().split()))
    cnt[a] += v
    if mx[0] == a and v > 0:
        mx[1] += v

    elif mx[0] == a:
        mx[0], mx[1] = spam()

    elif mx[1] < cnt[a]:
        mx[0], mx[1] = a, cnt[a]

    elif mx[1] == cnt[a] and mx[0] > a:
        mx[0], mx[1] = a, cnt[a]

    print("%d %d" % (mx[0], mx[1]))
l = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
i = int(input())
print(l[i])


### FIXED CODE ###

l = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
i = int(input())
print(l[i-1])
from collections import Counter
import sys
input = sys.stdin.readline

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

mod = 10**9+7 #出力の制限
N = 10**4
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 )


l = int(input())
#A=list(map(int, input().split()))
A=[int(i) for i in input().split()]

S = Counter(A)

for i in range(l):
  tmp = []
  S[A[i]] -= 1
  for j in S.keys():
    tmp.append(cmb(S[j],2,mod))
  S[A[i]] += 1
  print(sum(tmp))


### FIXED CODE ###

from collections import defaultdict,Counter
import sys

n = int(input())
a = list(map(int, sys.stdin.readline().split()))

d = Counter(a)
e = defaultdict(int)

base = sum(v * (v - 1) // 2 for v in d.values())
e = {k: base - (v >= 2) * (v - 1) for k, v in d.items()}

for x in a:
  print(e[x])
a,b,c,d = map(int,input())
print(max(a*c,a*d,b*c,b*d))

### FIXED CODE ###

a,b,c,d = map(int,input().split())
print(max(a*c,a*d,b*c,b*d))
N,M=map(int, input().split()) 
P=list(map(int,input().split()))
par=[i for i in range(N+1)]
rank=[0]*(N+1)

#根を探す
def find(x):
  if par[x]==x:
    return x
  else:
    par[x]==find(par[x])
    return par[x]

#同じ集合か判定
def same(x,y):
  return find(x)==find(y)

def union(x,y):
  x=find(x)
  y=find(y)
  if x==y:
    return 0
  if rank[x]<rank[y]:
    par[x]=y
  else:
    par[y]=x
    if rank[x]==rank[y]:
      rank[x]+=1

for i in range(M):
  a,b=map(int,input().split())
  union(a,b)


print(par)
print(rank)     
  
ans=0
for i in range(1,N+1):
  print(i,P[i-1])
  if same(P[i-1],i):
    ans+=1
print(ans)

### FIXED CODE ###

N,M=map(int, input().split()) 
P=list(map(int,input().split()))
par=[i for i in range(N+1)]
rank=[0]*(N+1)
#根
def find(x):
  if x==par[x]:
    return x
  else:
    par[x]=find(par[x])
    return par[x]
  
def find(x):
    if x == par[x]:
        return x
    par[x] = find(par[x])
    return par[x]
  
#同じ集合か判定
def same(x,y):
  return find(x)==find(y)

def union(x,y):
  x=find(x)
  y=find(y)
  if x==y:
    return 0
  if rank[x]<rank[y]:
    par[x]=y
  else:
    par[y]=x
    if rank[x]==rank[y]:
      rank[x]+=1

for i in range(M):
  a,b=map(int,input().split())
  union(a,b)

ans=0
for i in range(1,N+1):
  if same(P[i-1],i):
    ans+=1
print(ans)
n = int(input())
d = list(map(int, input().split()))

sum = 1
if d[0] == 0 and d.count(0)==1:
  for i in range(1, n):
    if int(d[i]) >2:
      sum *= int(d[i]) 
  print(sum)
else:
  print("0")
  

### FIXED CODE ###

n = int(input())


if n%2 == 0:
  print(int(n/2-1))
else:
  print(int(n/2))
import math

n=int(input())
a=[int(input()) for i in range(n)]

print(4+math.ceil(n/min(a)))

### FIXED CODE ###

import math

n=int(input())
a=[int(input()) for i in range(5)]

print(4+math.ceil(n/min(a)))
# -*- coding: utf-8 -*-

#input
import numpy as np
import sys
sys.setrecursionlimit(10**6) 
[X,Y,Z,K] = list(map(int,input().split()))
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))

D = []
A.sort(reverse=True)
B.sort(reverse=True)
C.sort(reverse=True)

#make list
memo = np.zeros((X,Y,Z))
for i in range(min(K,X)):
    for j in range(min((K//(i+1))+1,Y)):
        for k in range(min(((K//(i+1))+1)//(j+1),Z)):
            if memo[i][j][k] != 0:
                continue
            else:
                memo[i][j][k] = A[i]+B[j]+C[k]
                D.append(memo[i][j][k])
D.sort(reverse=True)
for i in range(K):
    print(int(D[i]))

### FIXED CODE ###

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

#input
import numpy as np
[X,Y,Z,K] = list(map(int,input().split()))
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))

D = []
A.sort(reverse=True)
B.sort(reverse=True)
C.sort(reverse=True)

#make list
for i in range(min(K,X)):
    for j in range(min((K//(i+1))+1,Y)):
        for k in range(min(((K//(i+1))+1)//(j+1),Z)):
                D.append(A[i]+B[j]+C[k])
D.sort(reverse=True)
for i in range(K):
    print(int(D[i]))
import sys
import collections

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


def main():
    N = int(input())
    XY = [[int(x) for x in input().split()] for _ in range(N)]

    c = collections.Counter()

    for i in range(N):
        for j in range(N):
            if i == j:
                continue
            xi, yi = XY[i]
            xj, yj = XY[j]
            c[(xi - xj, yi - yj)] += 1

    print(N - c.most_common()[0][1])


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
import collections

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


def main():
    N = int(input())
    XY = [[int(x) for x in input().split()] for _ in range(N)]

    c = collections.Counter()

    if N == 1:
        print(1)
        return

    for i in range(N):
        for j in range(N):
            if i == j:
                continue
            xi, yi = XY[i]
            xj, yj = XY[j]
            c[(xi - xj, yi - yj)] += 1

    print(N - c.most_common()[0][1])


if __name__ == '__main__':
    main()
S,T = str(stdin.readline().rstrip()).lower()
S = S[::-1]
if S == T:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

S = input().lower()
T = input().lower()
for i in range(len(S)):
  S = S[len(S)-1:len(S)] + S[0:len(S)-1]
  if S == T:
    break
if S == T:
  print("Yes")
else:
  print("No")
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
n = 0
if e-a > k or e-b > k or d-a > k or e-c > k or d-b > k or c-a > k or e-d > k or d-c > k or c-b > k or b-a > k:
    n = 1

if n = 1:
    print(":(")
if n = 0:
    print("Yay!")

### FIXED CODE ###

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
n = 0
if e-a > k or e-b > k or d-a > k or e-c > k or d-b > k or c-a > k or e-d > k or d-c > k or c-b > k or b-a > k:
    n = 1

if n == 1:
    print(":(")
if n == 0:
    print("Yay!")
N,M=map(int,input().split())
A=[0]*M
pen=0
for i in range(M):
  p,S=input().split()
  if S=="AC":
    A[int(p)-1]=1
  elif S=="WA" and A[int(p)-1]==0:
    pen += 1
print(sum(A),pen)

### FIXED CODE ###

N,M=map(int,input().split())
A=[0]*N
B=[0]*N
pen=0
for i in range(M):
  p,S=input().split()
  if S=="AC":
    A[int(p)-1]=1
  elif S=="WA" and A[int(p)-1]==0:
    B[int(p)-1] += 1
penalty=[A[i]*B[i] for i in range(N)]
print(sum(A),sum(penalty))
N, M = map(int,input().split())

if M == 0:
    print(0)
    exit(0)

slist = [list(map(int,input().split())) for i in range(M)]

mlist = [-1 for i in range (M+1)]

for lis in slist:
    if mlist[lis[0]] != -1:
        if mlist[lis[0]] != lis[1]:
            print(-1)
            exit(0)
    else:
        if lis[0] == 1 and lis[1] == 0:
            print(-1)
            exit(0)
        mlist[lis[0]] = lis[1]

# print(mlist)

reslist = []

for j in range(1, M+1):
    # print(mlist[j])
    if mlist[j] == -1:
        if j == 1:
            reslist.append(1)
        else:
            reslist.append(0)
    else:
        reslist.append(mlist[j])

# print(reslist)

print("".join(map(str,reslist)))

### FIXED CODE ###

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

reslist = []

if M == 0:
    if N == 1:
        print(0)
        exit(0)
    else:
        print('1' + '0'*(N-1))
        exit(0)

slist = [list(map(int,input().split())) for i in range(M)]

mlist = [-1 for i in range (N+1)]

for lis in slist:
    if mlist[lis[0]] != -1:
        if mlist[lis[0]] != lis[1]:
            print(-1)
            exit(0)
    else:
        mlist[lis[0]] = lis[1]

# print(mlist)



for j in range(1, N+1):
    # print(mlist[j])
    if mlist[j] == 0 and N > 1 and j == 1:
        print(-1)
        exit(0)
    if mlist[j] == -1:
        if j == 1:
            reslist.append(1)
        else:
            reslist.append(0)
    else:
        reslist.append(mlist[j])

# print(reslist)

print("".join(map(str,reslist)))
K = int(input())
A, B = map(int, input().split()) 
i = 0
j = 0
if(A==B):
  if(A%K==0):
    print('OK')
  else:
    prin('NG')
for x in range(A, B):
    if A / K == B  or (x % K == 0 or K % x == 0):
        print('OK')
        i += 1
        break
if i == 0:
    print('NG')

### FIXED CODE ###

k = int(input())
a,b = map(int, input().split())
if b//k * k >= a:
    print('OK')
else:
    print('NG')
ld, rd = [0, 0, 0, 0]. [0, 0, 0, 0]
while True:
    try:
        l, r = map(float, input().split())
        if l < 0.2:
            ld[3] += 1
        elif l < 0.6:
            ld[2] += 1
        elif l < 1.1:
            ld[1] += 1
        else:
            ld[0] += 1

        if r < 0.2:
            rd[3] += 1
        elif r < 0.6:
            rd[2] += 1
        elif r < 1.1:
            rd[1] += 1
        else:
            rd[0] += 1

    except:
        break

for l, r in zip(ld, rd):
    print(l, r)

### FIXED CODE ###

ld, rd = [0, 0, 0, 0], [0, 0, 0, 0]
while True:
    try:
        l, r = map(float, input().split())
        if l < 0.2:
            ld[3] += 1
        elif l < 0.6:
            ld[2] += 1
        elif l < 1.1:
            ld[1] += 1
        else:
            ld[0] += 1

        if r < 0.2:
            rd[3] += 1
        elif r < 0.6:
            rd[2] += 1
        elif r < 1.1:
            rd[1] += 1
        else:
            rd[0] += 1

    except:
        break

for l, r in zip(ld, rd):
    print(l, r)
N,M=map(int,input().split())
G=[[] for i in range(N)]
a,b=0,0
for i in range(M):
  a,b=map(int,input().split())
  G[b-1].append(a-1)
DP=[-1]*N
def f(x):
  if DP[x]!=-1:
    return DP[x]
  DP[x]=0
  for i in range(len(G[x])):
    DP[x]=max(DP[x],f(G[x][i])+1)
  return DP[x]

for i in range(N):
  f(i)
print(max(DP))

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**9)
N,M=map(int,input().split())
G=[[] for i in range(N)]
a,b=0,0
for i in range(M):
  a,b=map(int,input().split())
  G[b-1].append(a-1)
DP=[-1]*N
def f(x):
  if DP[x]!=-1:
    return DP[x]
  DP[x]=0
  for i in range(len(G[x])):
    DP[x]=max(DP[x],f(G[x][i])+1)
  return DP[x]

for i in range(N):
  f(i)
print(max(DP))
n = int(input())
    def c(x,y):
        if 0 <= x < n and 0 <= y < 2:
            if cache[y][x] != " ":
                return cache[y][x]
     
            if x == 0 and y == 0:
                total = matrice[0][0]
            else:
                if x > 0:
                    tt1 = c(x-1,y)
                else:
                    tt1 = 0
                if y > 0:
                    tt2 = c(x,y-1)
                else:
                    tt2 = 0
                total = max(tt1,tt2) + matrice[y][x]
            cache[y][x] = total
            return total
     
        
    matrice = []
    cache = [ [" " for i in range(n)] for a in range(2) ] 
    for i in range(2):
        matrice.append( [ int(i) for i in input().split() ] )
     
    print( c(n-1,1) )

### FIXED CODE ###

n = int(input())
def c(x,y):
    if 0 <= x < n and 0 <= y < 2:
        if cache[y][x] != " ":
            return cache[y][x]

        if x == 0 and y == 0:
            total = matrice[0][0]
        else:
            if x > 0:
                tt1 = c(x-1,y)
            else:
                tt1 = 0
            if y > 0:
                tt2 = c(x,y-1)
            else:
                tt2 = 0
            total = max(tt1,tt2) + matrice[y][x]
        cache[y][x] = total
        return total

    
matrice = []
cache = [ [" " for i in range(n)] for a in range(2) ] 
for i in range(2):
    matrice.append( [ int(i) for i in input().split() ] )

print( c(n-1,1) )
a,b=input(),split()

print(a+' '+b)


### FIXED CODE ###

a,b = input().split()
a = int(a)
b = int(b)
S = a*b
C = 2 * (a+b)

print(str(S) + " " + str(C))
import copy

N = int(input())
A = []
for i in range(N):
    A.append(int(input()))

chinpo = max(A)
B = copy.copy(A)
B.remove(max(A))
chinchin = max(B)

for i in range(N):
    if i == A.index("max(A)"):
        print(chinpo)
    else:
        print(chinchin)



### FIXED CODE ###

import copy

N = int(input())
A = []
for i in range(N):
    A.append(int(input()))

chinpo = max(A)
B = copy.copy(A)
B.remove(max(A))
chinchin = max(B)

for i in range(A.index(max(A))):
    print(chinpo)
print(chinchin)
for i in range(A.index(max(A))+1,N):
    print(chinpo)
a = []
a = input()
f = len(a)



print(a[3])


if a[f-1] == "3":
  print("bon")
elif a[f-1] == "0" or a[f-1] == "6" or a[f-1] == "1" or a[f-1] == "8":
  print("pon")
else:
  print("hon")

### FIXED CODE ###

a = []
a = input()
f = len(a)






if a[f-1] == "3":
  print("bon")
elif a[f-1] == "0" or a[f-1] == "6" or a[f-1] == "1" or a[f-1] == "8":
  print("pon")
else:
  print("hon")
print(X*X*X)

### FIXED CODE ###

i=int(input())
print(i**3)
N, X = map(int, input().split())
x = list(map(int, input().split()))
for i in range(N):
    x[i] = abs(x[i] - X)
m = x[0]
import math
for i in range(1, N):
    m = math.gcd(m, x[i])
print(m)

### FIXED CODE ###

N, X = map(int, input().split())
x = list(map(int, input().split()))
for i in range(N):
    x[i] = abs(x[i] - X)
m = x[0]
import fractions
for i in range(1, N):
    m = fractions.gcd(m, x[i])
print(m)
N=int(input())
A=list(map(int,input().split()))
ans = 1
if 0 in A:
  print(0)
  return
else:
  for a in A:
    ans *= a
    if ans > 10**18:
      print(-1)
      return
  print(ans)


### FIXED CODE ###

def main ():
	N = int(input())
	A = list(map(int,input(). split ()))
	if 0 in A:
		print(0)
		return
	prod = 1
	for a in A:
		prod *= a
		if prod > 1000000000000000000:
			print(-1)
			return
	print(prod)
main ()