Harryxun/stf_run huggingface dataset:
a, b, c, d = map(int,list(input().strip()))

b_case = [b, -b]
c_case = [c, -c]
d_case = [d, -d]

ans = ''

for i in b_case:
    for j in c_case:
        for k in d_case:
            if a + i + j + k == 7:
                print('{}{:+}{:+}{:+}{}'.format(a, i, j, k, '=7'))
                flag = True
                break
        
        if flag == True:
            break
    if flag == True:
        break

### FIXED CODE ###

a, b, c, d = list(map(int, list(input())))
if a + b + c + d == 7:
    print("{0}+{1}+{2}+{3}=7".format(a, b, c, d))
elif a + b + c - d == 7:
    print("{0}+{1}+{2}-{3}=7".format(a, b, c, d))
elif a + b - c + d == 7:
    print("{0}+{1}-{2}+{3}=7".format(a, b, c, d))
elif a - b + c + d == 7:
    print("{0}-{1}+{2}+{3}=7".format(a, b, c, d))
elif a - b - c + d == 7:
    print("{0}-{1}-{2}+{3}=7".format(a, b, c, d))
elif a - b + c - d == 7:
    print("{0}-{1}+{2}-{3}=7".format(a, b, c, d))
elif a + b - c - d == 7:
    print("{0}+{1}-{2}-{3}=7".format(a, b, c, d))
elif a - b - c - d == 7:
    print("{0}-{1}-{2}-{3}=7".format(a, b, c, d))
from collections import defaultdict
import sys
import math
from datetime import datetime


class TreeNode:
    def __init__(self):
        self.val = 0
        self.vertex = []

def make_trees(n, A, B):
    trees = []
    for i in range(n):
        trees.append(TreeNode())
    for i in range(len(A)):
        a = A[i]-1
        b = B[i]-1
        trees[a].vertex.append(b)
    return trees

def dfs(node: TreeNode, x: int, trees):
    if node:
        node.val += x
        for i in node.vertex:
            dfs(trees[i], x, trees)


def sol(n, q, A, B, P, X):
    trees = make_trees(n, A, B)
    for i in range(len(P)):
        p = P[i]-1
        x = X[i]
        t = trees[p]
        # dfs, give point x
        dfs(t, x, trees)
    #
    return " ".join([str(t.val)  for t in trees])
    #return n, q, A, B, P, X



do_submit = True
#do_submit = False

def input_parse(input_str):
    lines = [x.strip() for x in input_str.split("\n") if x.strip()]
    parsed_lines = [list(map(str, line.split())) for line in lines]
    print(parsed_lines)
    n = int(parsed_lines[0][0])
    q = int(parsed_lines[0][1])
    A = []
    B = []
    P = []
    X = []
    for i in range(1, n-1+1):
        a = int(parsed_lines[i][0])
        b = int(parsed_lines[i][1])
        A.append(a)
        B.append(b)
    for i in range(n, 1+n+q-1):
        p = int(parsed_lines[i][0])
        x = int(parsed_lines[i][1])
        P.append(p)
        X.append(x)

    # S = parsed_lines[1][0]
    # return n, k, S
    return n, q, A, B, P, X


if not do_submit:
    n, q, A, B, P, X = input_parse("""
    4 3
    1 2
    2 3
    2 4
    2 10
    1 100
    3 1
    """)
    print(sol(n, q, A, B, P, X))

    n, q, A, B, P, X = input_parse("""
        6 2
        1 2
        1 3
        2 4
        3 6
        2 5
        1 10
        1 10
    """)
    print(sol(n, q, A, B, P, X))

else:
    # n = int(input().strip())
    # q = int(input().strip())
    n, q = list(map(int, input().split()))
    A = []
    B = []
    P = []
    X = []
    for i in range(n-1):
        a, b = list(map(int, input().split()))
        # a = int(input().strip())
        # b = int(input().strip())
        A.append(a)
        B.append(b)
    for i in range(q):
        p, x = list(map(int, input().split()))
        # p = int(input().strip())
        # x = int(input().strip())
        P.append(p)
        X.append(x)
    print(sol(n, q, A, B, P, X))

### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(1000000)
n, q = map(int, input().split())
 
ki = [[] for i in range(n + 1)]
for i in range(n - 1):
    a, b = map(int, input().split())
    ki[a].append(b)
    ki[b].append(a)
# print(ki)
 
cnt = [0] * (n + 1)
for i in range(q):
    p, x = map(int, input().split())
    cnt[p] += x
 
 
# print(cnt)
 
 
def d(y, parent):
    for i in ki[y]:
        if i == parent:
            continue
        cnt[i] += cnt[y]
        d(i, y)
 
 
d(1, -1)
print(*cnt[1:])
import sys
input=sys.stdin.readline()
from _collections import deque
n,m=map(int,input().split())
edg=[[] for i in range(n+1)]
for i in range(m):
    a,b=map(int,input().split())
    edg[a].append(b)
    edg[b].append(a)
dep=[-1]*(n+1)
dep[1]=0
data=deque([1])
while len(data)>0:
    p=data.popleft()
    for i in edg[p]:
        if dep[i]==-1:
            dep[i]=dep[p]+1
            data.append(i)
print("POSSIBLE" if dep[n]==2 else "IMPOSSIBLE")



### FIXED CODE ###

from _collections import deque
n,m=map(int,input().split())
edg=[[] for i in range(n+1)]
for i in range(m):
    a,b=map(int,input().split())
    edg[a].append(b)
    edg[b].append(a)
dep=[-1]*(n+1)
dep[1]=0
data=deque([1])
while len(data)>0:
    p=data.popleft()
    for i in edg[p]:
        if dep[i]==-1:
            dep[i]=dep[p]+1
            data.append(i)
print("POSSIBLE" if dep[n]==2 else "IMPOSSIBLE")
N, K = map(int, input().split())
hlist = [int(input()) for _ in range(N)]
h_sorted = sorted(hlist)
mae_3 = sum(h_sorted)[:3]
usiro_3 = sum(h_sorted)[-3:]
print(mae_3 if mae_3 < usiro_3 else usiro_3)

### FIXED CODE ###

N,K = map(int,input().split())
hlist = [int(input()) for _ in range(N)]
hlist.sort(reverse=True)
sa = []

for _ in range(N-K+1):
    num = hlist[_]-hlist[_+(K-1)]
    sa.append(num)
sa.sort()
print(sa[0])
a = int(input())
b = int(input())
if a%2 = 0 or b%2 =0:
    print("even")
else:
    print("odd")


### FIXED CODE ###

a, b = map(int,input().split())
if a*b % 2 == 0:
    print("Even")
else:
    print("Odd")
# -*- coding: utf-8 -*-
n = int(input())
v = map(int, input().split())
c = map(int, input().split())
ri = 0
for i in range(0,n):
    a  = v[i] - c[i] 
    if a>0:
        ri += a
    else:
        pass
print(ri)

### FIXED CODE ###

# -*- coding: utf-8 -*-
n = int(input())
v = list(map(int, input().split()))
c = list(map(int, input().split()))
ri = 0
for i in range(0,n):
    a  = v[i] - c[i] 
    if a>0:
        ri += a
    else:
        pass
print(ri)
import sys
import re
import math
import collections
import bisect
import itertools
import fractions
import functools
import copy
import heapq
import decimal
import statistics
import queue

# import numpy as np

sys.setrecursionlimit(10 ** 9)
INF = 10 ** 16
MOD = 10 ** 9 + 7
# MOD = 998244353

ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))
na1 = lambda: list(map(lambda x: int(x) - 1, sys.stdin.readline().split()))


# ===CODE===

def main():
    x, y, z, w = ns()
    a = na()
    b = na()
    c = na()

    a.sort(reverse=True)
    b.sort(reverse=True)
    c.sort(reverse=True)

    ans = []
    for i in range(x):
        if x > 3000:
            break
        for j in range(y):
            if x * y > 3000:
                break
            for k in range(z):
                if x * y * z > 3000:
                    break
                ans.append(a[i] + b[j] + c[k])
    ans.sort(reverse=True)

    for i in range(w):
        print(ans[i])


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
import re
import math
import collections
import bisect
import itertools
import fractions
import functools
import copy
import heapq
import decimal
import statistics
import queue

# import numpy as np

sys.setrecursionlimit(10 ** 9)
INF = 10 ** 16
MOD = 10 ** 9 + 7
# MOD = 998244353

ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))
na1 = lambda: list(map(lambda x: int(x) - 1, sys.stdin.readline().split()))


# ===CODE===

def main():
    x, y, z, w = ns()
    a = na()
    b = na()
    c = na()

    a.sort(reverse=True)
    b.sort(reverse=True)
    c.sort(reverse=True)

    ans = []
    for ai in a:
        for bi in b:
            ans.append(ai + bi)

    ans.sort(reverse=True)
    ans = ans[:3010]

    res = []
    for ci in c:
        for i in range(len(ans)):
            res.append(ci + ans[i])
    res.sort(reverse=True)

    for i in range(w):
        print(res[i])


if __name__ == '__main__':
    main()
n,k=map(int,input().split())
a=tuple(map(int,input().split()))
l=[0]
for i in range(1,n):
  b=a[i]
  l+=[min(l[-j]+abs(b-a[-j])for j in range(1,min(i,k)+1))]
  if i>=k:
    del a[0]
    del l[0]
print(l[-1])


### FIXED CODE ###

n,k=map(int,input().split())
a=list(map(int,input().split()))
l=[0]
for i in range(1,n):
  b=a[i]
  l.append(min(l[j]+abs(b-a[j])for j in range(i-min(k,i),i)))
print(l[-1])
n,q = map(int, input().split())

tree = dict()
for i in range(n-1):
  a,b = map(int, input().split())
  if a in tree: tree[a].add(b)
  else: tree[a] = {b}
  if b in tree: tree[b].add(a)
  else: tree[b] = {a}

opr = {i+1:0 for i in range(n)}
for i in range(q):
  p,x = map(int, input().split())
  opr[p] += x

ans = [0]*n

def dfs(v,p,value): #p: parent of v
  value += opr[v]
  ans[v-1] = value
  for c in tree[v]:
    if c == p: continue
    dfs(c,v,value)

dfs(1,-1,0)

print(*ans)

### FIXED CODE ###

import sys
read = sys.stdin.read
readline = sys.stdin.readline

n,q = map(int, input().split())
ABPX = list(map(int,read().split()))
AB = iter(ABPX[:n+n-2])
PX = iter(ABPX[n+n-2:])

tree = dict()
for a,b in zip(AB,AB):
  if a in tree: tree[a].add(b)
  else: tree[a] = {b}
  if b in tree: tree[b].add(a)
  else: tree[b] = {a}

opr = {i+1:0 for i in range(n)}
for p,x in zip(PX,PX):
  opr[p] += x

stack = [1]
parent = [0] * (n+1)
ans = [0]*n
while stack:
  x = stack.pop()
  ans[x-1] += opr[x]
  for y in tree[x]:
    if y == parent[x]: continue
    parent[y] = x
    stack.append(y)
    ans[y-1] += ans[x-1]

print(*ans)
str1, str2 = [s for s in input().split()]
a = str1*int(str2)
b = str2*int(str1)
int(a)
int(b)
list = [a, b]
list.sort();
print(list[0])

### FIXED CODE ###

str1, str2 = [s for s in input().split()]
if str1 == str2:
    print('Yes')
else:
    print('No')
N,M=map(int,input().split())
foods=[0]*M

for i in range(N):
  KA=list(map(int,input().split())


for a in KA[1:]:
  foods[a-1]+=1

cnt=0
for j in foods:
  if j==N:
    cnt+=1

print(cnt)


### FIXED CODE ###

N,M = map(int,input().split())
foods = [0]*M
 
for i in range(N):
  KA = list(map(int,input().split()))
  
  for a in KA[1:]:
    foods[a-1] += 1
  
cnt = 0
for j in foods:
  if j == N:
    cnt += 1
    
print(cnt)
N, M = map(int, input().split())
cy = [1] * M
city = []

for i in range(M):
  p, y = map(int, input().split())
  city.append((y, p, i))
city.sort()

ans = [""] * M

for y, p, i in city:
  ans[i] = ("000000" + str(p))[-6:] + ("000000" + str(cy[p-1]))[-6:]
  cy[p-1] += 1

print(*ans, sep="\n")

### FIXED CODE ###

N, M = map(int, input().split())
cy = [1] * N
city = []

for i in range(M):
  p, y = map(int, input().split())
  city.append((y, p, i))
city.sort()

ans = [""] * M

for y, p, i in city:
  ans[i] = ("000000" + str(p))[-6:] + ("000000" + str(cy[p-1]))[-6:]
  cy[p-1] += 1

print(*ans, sep="\n")
a=list(input())
b=a.copy()
b.reverse()
n=len(a)
t=a[:(n-1)//2]
s=t.copy()
s.reverse()
r=a[(n+3)//2-1:n]
rr=r.copy()
rr.reverse()

if a==b and r==rr and t==s:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

def reverse(s):
    return s[::-1]
a=str(input())
b=reverse(a)
n=len(a)
c=a[:(n-1)//2]
d=reverse(c)
e=a[(n+3)//2-1:n]
f=reverse(e)

if a==b and c==d and e==f:
    print('Yes')
else:
    print('No')
c=0
x=[-1,0,1,0]
y=[0,-1,0,1]
buf=[]
p=0
def count(h,w,S,table,H,W):
    global buf,x,y,p
    for i in range(4):
        if h+y[i]>=0 and h+y[i]<H and w+x[i]>=0 and w+x[i]<W:
            if table[h+y[i]][w+x[i]]==-1:
                if S[h][w]=='.' and S[h+y[i]][w+x[i]]=='#':
                    table[h+y[i]][w+x[i]]=table[h][w]+1
                    buf.append([h+y[i],w+x[i]])
                elif S[h][w]=='#' and S[h+y[i]][w+x[i]]=='.':
                    table[h+y[i]][w+x[i]]=table[h][w]+1
                    buf.append([h+y[i],w+x[i]])
    if buf:
        a=buf.pop(0)
        count(a[0],a[1],S,table,H,W)

H,W=map(int,input().split())
S=[]
for i in range(H):
    S.append(input())
for h in range(H):
    for w in range(W):
        if S[h][w]=='#':
            table=[[-1 for j in range(W)] for i in range(H)]
            table[h][w]=0
            p=0
            count(h,w,S,table,H,W)
            for k in range(H):
                for l in range(W):
                    if table[k][l]%2==1 and table[k][l]!=-1:
                        c+=1
print(c)




### FIXED CODE ###

import sys
c=0
b=0
wi=0
x=[-1,0,1,0]
y=[0,-1,0,1]
buf=[]
def one():
    return -1
def count(h,w,S,table,H,W,index):
    global buf,x,y,b,wi
    if index==1:
        b+=1
    else:
        wi+=1
    if index==1:
        S[h][w]='@'
    for i in range(4):
        if h+y[i]>=0 and h+y[i]<H and w+x[i]>=0 and w+x[i]<W:
            if table[h+y[i]][w+x[i]]==-1:
                if index==0 and S[h+y[i]][w+x[i]]=='#':
                    table[h+y[i]][w+x[i]]=1
                    buf.append([h+y[i],w+x[i],1])
                elif index==1 and S[h+y[i]][w+x[i]]=='.':
                    table[h+y[i]][w+x[i]]=1
                    buf.append([h+y[i],w+x[i],0])
    if buf:
        a=buf.pop(0)
        count(a[0],a[1],S,table,H,W,a[2])
sys.setrecursionlimit(10000000)
H,W=map(int,input().split())
T=[]
table=[[-1 for j in range(W)] for i in range(H)]
for i in range(H):
    T.append(input())
S=[['' for j in range(W)]for i in range(H)]
for h in range(H):
    for w in range(W):
        S[h][w]=T[h][w]
for h in range(H):
    for w in range(W):
        if S[h][w]=='#':
            table[h][w]=0
            count(h,w,S,table,H,W,1)
            c+=b*wi
            b=0
            wi=0
print(c)
from itertools import accumulate
import numpy as np

def main():
    N, K = map(int, input().split())
    As = list(map(int, input().split()))
    
    dp = np.array([0] * (K+1))
    dp[0] = 1
    nonzeros = [np.array([0])]
    for a in As:
        ndp = np.array([0] * (K+1))
        nonzero = []
        for i in range(K+1):
            t = dp[i] if i < a else dp[i] + dp[i-a]
            if t > 0:
                nonzero.append(i)
                ndp[i] = 1
        nonzeros.append(np.array(nonzero))
        dp = ndp
    
    dp = np.array([0] * (K+1))
    dp[0] = 1
    acc = list(accumulate(dp)) + [0]
    ans = 0
    for i in range(N, 0, -1):
        a = As[i-1]
        ndp = np.array([0] * (K+1))
        for j in range(K+1):
            t = dp[j] if j < a else dp[j] + dp[j-a]
            if t > 0:
                ndp[i] = 1
        dp = ndp
        if a < K:
            nonzero = nonzeros[i-1]
            for y in nonzero:
                t = K-y-a-1
                if acc[K-y-1] > acc[t if t >= 0 else -1]:
                    break
            else:
                ans += 1
        acc = list(accumulate(dp)) + [0]
    
    print(ans)

main()


### FIXED CODE ###

from itertools import accumulate

def main():
    N, K = map(int, input().split())
    As = list(map(int, input().split()))
    
    nonzeros = [1]
    for a in As:
        ndp = nonzeros[-1]
        if a <= K:
            ndp |= (nonzeros[-1] % (1 << (K-a))) << a
        nonzeros.append(ndp)
    dp = [0] * (K+1)
    dp[0] = 1
    acc = list(accumulate(dp)) + [0]
    ans = 0
    for i in range(N, 0, -1):
        a = As[i-1]
        ndp = []
        for j in range(K+1):
            t = dp[j] if j < a else dp[j] + dp[j-a]
            ndp.append(0 if t == 0 else 1)
        dp = ndp
        if a < K:
            nonzero = nonzeros[i-1]
            for y in range(K+1):
                if nonzero & 1:
                    t = K-y-a-1
                    if acc[K-y-1] > acc[t if t >= 0 else -1]:
                        break
                nonzero >>= 1
            else:
                ans += 1
        acc = list(accumulate(dp)) + [0]
    
    print(ans)

main()
for i in range(5):
  a=int(input())
  b=int(input())
  c=int(input())
  d=int(input())
  e=int(input())
  if a<0:
    x=abs(a)*c+d+b*e
    print(x)
  else:
    y=(b-a)*e
    print(y)


### FIXED CODE ###

a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
if a<0:
  x=-a*c+d+b*e
  print(x)
else :
  y=(b-a)*e
  print(y)
a=input()
b=Sunny
c=Cloudy
d=Rainy
if a=b:
print(c)
elif a=c:
print(d)
else:
print(b)

### FIXED CODE ###

a = input()
b = 'Sunny'
c = 'Cloudy'
d = 'Rainy'
if a == b:
 print(c)
if a == c:
 print(d)
if a == d:
 print(b)
N=int(input())
M=int(input())
if N>M>:
   print(N-M)
else:
   print(-1)

### FIXED CODE ###

N,M=map(int,input().split())
A=list(map(int,input().split()))
B=0
for i in A:
    B=B+i       
N=N-B
if 0<=N:
    print(N)
else:
    print(-1)
import math
N,X,T=input().split()
B=math.ceil(N/X)
A=T*B
print(A)

### FIXED CODE ###

import math
n, x, t = map(int, input().split())
if n % x == 0:
    c = n / x
else:
    b = n / x
    c = math.ceil(b)
a = int(c * t)
print(a)
from sys import stdin

x, y = [int(x) for x in stdin.readline().rstrip().split()]


if y < 2*x and 4*x < y:
    print('No')
else:
    if (4*x-y) % 2 == 0:
        print('Yes')
    else:
        print('No')


### FIXED CODE ###

from sys import stdin

a = [int(x) for x in stdin.readline().rstrip().split()]


for i, x in enumerate(a):
    i += 1
    if x == 0:
        print(i)
import copy as cp
n,k = map(int,input().split())
lamps = list(map(int,input().split()))
for j in range(k):
    lamplog = [0]*n
    lamp_io = [0]*n
    for i in range(len(lamps)):
        if(i == 0):
            lamplog[i]=[0,lamps[i]]
        elif(i == n-1):
            lamplog[i]=[n-(lamps[i]+1) ,n-1]
        else:
            lamplog[i]= [max(i-lamps[i],0),min(i+lamps[i],n-1)]
    for i in range(len(lamplog)):
        for l in range(lamplog[i][1]-lamplog[i][0]+1):
            lamp_io[lamplog[i][0]+l]+=1
    # print(lamplog)
    lamps = cp.copy(lamp_io)
ans = ""
for i in range(len(lamp_io)):
    ans += str(lamp_io[i]) +" "
print(ans.rstrip())

### FIXED CODE ###

from numba import jit
@jit
def main():
    n,k = map(int,input().split())
    lamps = list(map(int,input().split()))
    for ki in range(k):
        lamplog = [0]*(n+1)
        for i in range(n):
            lamplog[max(0,i-lamps[i])  ] += 1   #先端を出す
            lamplog[min(i+lamps[i]+1,n)] -= 1   #末尾を出す
        # print(lamplog)
        for i in range(n):                      #累積和を計算
            lamplog[i+1] += lamplog[i]
        # print(lamplog)
        lamplog.pop()
        if(lamplog == lamps):                   #１つ前の結果と今回の結果が同じだったら。
            break
        lamps = lamplog                         #今回の結果を記録
    return lamplog

lamplog = main()
ans = ""
for i in range(len(lamplog)):
    ans += str(lamplog[i]) +" "
print(ans.rstrip())
from math import floor

a, b = [i for i in input().split()]
B = int(b[0] + b[1] + b[2])
print(int(a) * B // 10);

### FIXED CODE ###

from math import floor

a, b = [i for i in input().split()]
B = int(b[0] + b[2] + b[3])
print(int(a) * B // 100);
n,m = map(int,input().split())
alis = list(map(int,input().split()))
lis = [list(map(int,input().split())) for x in range(m)]
clis = [[x[1]]*x[0] for x in lis]
clis = [[x for x in y]for y in clis]
clis.sort(reverse=True)
alis.sort()
ans_lis=[x if x>=y else y for x,y in zip(alis,clis)]
if len(clis) < len(alis):
    ans__ = sum(alis[len(clis):])
    ans_=sum(ans_lis)
    print(ans_+ans__)
else:
    print(sum(ans_lis))


### FIXED CODE ###

n,m = map(int,input().split())
alis = list(map(int,input().split()))
lis = [list(map(int,input().split())) for x in range(m)]
for x in alis:
    lis.append([1,x])
lis.sort(reverse=True,key=lambda x:x[1])
ans = 0
for x in lis:
    (number,point) = x
    if number >= n:
        number = n
        ans += number * point
        #print(n)
        #print(ans,'+=',number,'*',point)
        break
    ans += number * point
    n -= number
    #print(n)
    #print(ans,'+=',number,'*',point)
print(ans)
#print(lis)
A,B = map(int,input().split())
if A > B:
    print(A*2 - 1)
elif B > A:
    print(B*2 - 1)
else A == B:
    print(A*2)

### FIXED CODE ###

A, B = map(int,input().split())
if A > B:
    print(int(A) + int(A) - 1)
elif B > A:
    print(int(B) + int(B) - 1)
else:
    print(int(A) + int(A))
import math

A,B,N=map(int,input().split())
ans=[0]*(N+1)
for x in range(0,N+1):
    a=math.floor(A*x/B)
    b=A*math.floor((x/B))
    ans[x]+=a-b
print(ans)

### FIXED CODE ###

A,B,N=map(int,input().split())
x=min(B-1,N)
print(int(A*x/B)-int(x/B)*A)
import math
from functools import reduce

mod = 10**9 + 7

def lcm(a, b):
	return a * b // math.gcd(a, b)


N = int(input())
A = [i for i in map(int, input().split())]

ans = reduce(lcm, A)

B = [ans//i for i in A]

print(sum(B) % mod)


### FIXED CODE ###

#from math import gcd
from fractions import gcd
from functools import reduce

mod = 10**9 + 7

def lcm(a, b):
	return a * b // gcd(a, b)


N = int(input())
A = [i for i in map(int, input().split())]

ans = reduce(lcm, A)

#print(ans)
B = [ans//i for i in A]

print(sum(B) % mod)
A,B,K = map(int, input().split())
var = list(range(A, B + 1))
print(var)
ans = var[0:2]
ans += var[-2:]

for i in ans:
    print(i)


### FIXED CODE ###

A,B,K = map(int, input().split())
lcnt = 0
rcnt = 0
ans = []
for i in range(A, min(A + K, B)):
    ans.append(i)

for i in range(max(B - K + 1, A), B + 1):
    ans.append(i)

set_ans = list(set(ans))
set_ans.sort()
for i in set_ans:
    print(i)
x=input()
otoshi=x.split(" ")
N=int(otoshi[0])
Y=int(otoshi[1])
ten_t=Y//10000

if ten_t>N:
    ansa=-1 
    ansb=-1 
    ansc=-1
elif ten_t==N:
    if Y==100000*N:
        ansa=N
        ansb=0
        ansc=0
    else:
        ansa=-1 
        ansb=-1 
        ansc=-1
elif 0<=ten_t<N:
    for i in range(0,ten_t+1):
        ra=Y-10000*(ten_t-i)
        fiv_t=ra//5000
        
        if fiv_t+ten_t-i>N:
            ansa=-1 
            ansb=-1 
            ansc=-1
            break
        elif 0<=fiv_t+ten_t-i<=N:
            if ra==5000*(N-ten_t+i):
                ansa=ten_t-i
                ansb=N-ten_t+i
                ansc=0
                break
            else:
                for j in range(0,fiv_t+1):
                    rb=ra-5000*(fiv_t-j)
                    if rb==1000*(N-ten_t+i-fiv_t+j):
                        ansa=ten_t-i
                        ansb=fiv_t-j
                        ansc=N-ten_t+i-fiv_t+j
                        break
    
else:
    ansa=-1 
    ansb=-1 
    ansc=-1
print(ansa,ansb,ansc)                   

### FIXED CODE ###

N,Y=input().split()
n=int(N)
y=int(Y)//1000
p=y-n
s=y//10
t=y//5
i=-1
j=-1
k=-1
fl=False
for X in range(0,s+1):
    for Y in range(0,t+1):
        q=p-(9*X+4*Y)
        if q==0 and X+Y<=n:
            Z=n-X-Y
            i=X
            j=Y
            k=Z
            break
        if fl:
            break
    if fl:
        break
print(i,j,k)
import sys
l= sys.stdin.readline()
count = int(l.strip())
l = sys.stdin.readline()
nums = list(map(int, l.split()))
check = dict()
for n in nums:
  if n in check:
    print("YES")
   	break
  else:
    check[n] = True
print("YES")

### FIXED CODE ###

import sys
def main():
    l= sys.stdin.readline()
    count = int(l.strip())
    l = sys.stdin.readline()
    nums = list(map(int, l.split()))
    check = dict()
    for n in nums:
        if n in check:
            return "NO"
            
        else:
            check[n] = True
    return "YES"
if __name__ == "__main__":
    print(main())
import math
N = int(input())
T = []
for i in range(N):
    T.append(int(input()))
def lcm(x, y):
    return (x * y) // math.gcd(x, y)
g = lcm(T[0],T[1])
if len(T) > 2:
    for i in range(N-1):
        g = lcm(g,T[i+1])
print(g)

### FIXED CODE ###

import math
N = int(input())
T = []

def lcm(x, y):
    gc = math.gcd(x, y)
    ans = (x * y)//gc
    return ans

for i in range(N):
    T.append(int(input()))

    

if len(T) > 2:
    g = lcm(T[0],T[1])
    for i in range(3,N-1):
        g = lcm(g,T[i+1])
    print(g)
elif len(T) == 2:
    g = lcm(T[0],T[1])
    print(g)
else:
    print(T[0])
n,a = map(int.input().split())
b = list[]
for n:
  b.append(a)

plint(a**n)


### 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 ()