Harryxun/stf_run huggingface dataset:
s = input()
t = input()

dp = [[0]*(len(t)+1) for i in range(len(s)+1)]

for i in range(1,len(s)+1):
  for j in range(1,len(t)+1):
    dp[i][j] = max(dp[i-1][j-1],dp[i][j-1])
    if s[i-1] == t[j-1]:
      dp[i][j] += 1

ansl = []
cnt = dp[-1][-1]
def tami(i,j):
  global cnt
  if cnt == 0:
    return
  if s[i-1] == t[j-1]:
    cnt -= 1
    ansl.append(i-1)
  if dp[i-1][j-1]==cnt:
    tami(i-1,j-1)
  if dp[i][j-1]==cnt:
    tami(i,j-1)

tami(len(s),len(t))

ans = ""
for i in ansl:
  ans += s[i]
print(ans[::-1])

### FIXED CODE ###

import sys
sys.setrecursionlimit(1000000)

s = input()
t = input()

dp = [[0]*(len(t)+1) for i in range(len(s)+1)]

for i in range(1,len(s)+1):
  for j in range(1,len(t)+1):
    if s[i-1] == t[j-1]:
      dp[i][j] = max(dp[i-1][j-1]+1,dp[i-1][j],dp[i][j-1])
    else:
      dp[i][j] = max(dp[i-1][j],dp[i][j-1])

ansl = []
cnt = dp[-1][-1]
def tami(i,j):
  global cnt
  if cnt == 0:
    return
  if s[i-1] == t[j-1]:
    cnt -= 1
    ansl.append(i-1)
  if dp[i-1][j-1]==cnt:
    tami(i-1,j-1)
  elif dp[i][j-1]==cnt:
    tami(i,j-1)
  elif dp[i-1][j]==cnt:
    tami(i-1,j)

tami(len(s),len(t))

ans = ""
for i in ansl:
  ans += s[i]
print(ans[::-1])
input(S)
input(T)

print(T, end='')
print(S)

### FIXED CODE ###

S, T = input().split()
print(T + S)
l=input()
ls=l.split(" ")
X=int(ls[0])
N=int(ls[1])
lstr=input()
lst=lstr.split(" ")
fl=[]
if(lst!=[]):
    for a in lst:
         fl.append(int(a))
else:
    print(X)
for a in range(101):
    if(X-a not in fl):
         print(X-a)
         break
    if(X+a not in fl):
         print(X+a)
         break


### FIXED CODE ###

l=input()
ls=l.split(" ")
X=int(ls[0])
N=int(ls[1])
lstr=input()
lst=lstr.split(" ")
fl=[]
if(N!=0):
    for a in lst:
         fl.append(int(a))
for a in range(101):
    if(X-a not in fl):
         print(X-a)
         break
    if(X+a not in fl):
         print(X+a)
         break
import math
N = int(input())
a = list(map(int, input().split()))

for i in range(N - 1):
    a[i + 1] = math.gcd(a[i], a[i+1])

print(a[N-1])

### FIXED CODE ###

import fractions

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

for i in range(N - 1):
    a[i + 1] = fractions.gcd(a[i], a[i+1])

print(a[N-1])
n= int(input())
s= [input() for i in range(n)]
p1=list(set(s))
N=len(p1)
c=[0]*N
for i in range(N):
	c[i]=s.count(p1[i])
m =max(c)
c1=c.count(m)
ans=[0]
for i in range(N):
	if c[i]==m:
		ans.append(p1[i])
ans1=sorted(ans)
for i in range(c1):
	print(ans1[i])

### FIXED CODE ###

n= int(input())
s= sorted([input() for i in range(n)])
s.append("END")
ans=[]
max=-1
past=s[0]
c=1
for i in range(1,n+1):
	if past==s[i]:
		c+=1
	else:
		if c>max:
			max=c
			ans=[]
			ans.append(s[i-1])
		elif c==max:
			ans.append(s[i-1])
		c=1
	past=s[i]
for i in range(len(ans)):
	print(ans[i])
n = int(input())
h = list(map(int, input().split()))
cost = [-1] * n

def ans(n):
  if cost[n] != -1:
    return cost[n]
  cost[n] = min(ans(n-1) + abs(h[n-1] - h[n]), ans(n-2) + abs(h[n-2] - h[n]))
  return cost[n]

cost[0] = 0
cost[1] = abs(h[0] - h[1])
print(ans(n-1))

### FIXED CODE ###

import sys
sys.setrecursionlimit(1000000)

n = int(input())
h = list(map(int, input().split()))
cost = [-1] * n

def ans(n):
  if cost[n] != -1:
    return cost[n]
  cost[n] = min(ans(n-1) + abs(h[n-1] - h[n]), ans(n-2) + abs(h[n-2] - h[n]))
  return cost[n]

cost[0] = 0
cost[1] = abs(h[0] - h[1])
print(ans(n-1))
a=int(input())
b=int(input())
ans='Even' if (a * b % 2) == 0 else 'Odd'
print(ans)

### FIXED CODE ###

a,b=map(int,input().split())
ans="Even" if (a * b % 2) == 0 else "Odd"
print(ans)
a = int(input())
b = int(input())

flag1 = True
flag2 = True
flag3 = True

if a = 1:
    flag1 = False
elif a = 2:
    flag2 = False
elif a = 3:
    flag3 = False
    
if b = 1:
    flag1 = False
elif b = 2:
    flag2 = False
elif b = 3:
    flag3 = False
    
if flag1:
    print(1)
elif flag2:
    print(2)
else:
    print(3)

### FIXED CODE ###

a = int(input())
b = int(input())

flag1 = True
flag2 = True
flag3 = True

if a == 1:
    flag1 = False
elif a == 2:
    flag2 = False
elif a == 3:
    flag3 = False
    
if b == 1:
    flag1 = False
elif b == 2:
    flag2 = False
elif b == 3:
    flag3 = False
    
if flag1:
    print(1)
elif flag2:
    print(2)
else:
    print(3)
# -*- coding: utf-8 -*-
"""
Created on Sun Nov  4 21:46:51 2018

@author: sk
"""

# -*- coding: utf-8 -*-
"""
Created on Sun Nov  4 21:46:51 2018

@author: sk
"""


b =str( input())

a = list(b)



if b[0]==b[1]:
  if b[1]==b[2]:
    print("Yes")
  else :
    print("No")

elif b[1]==b[2]:
  if b[2]==b[3]:
    print("Yes")
  else :
    print("No")
else:
print("No")













### FIXED CODE ###

# -*- coding: utf-8 -*-
"""
Created on Sun Nov  4 21:46:51 2018

@author: sk
"""

# -*- coding: utf-8 -*-
"""
Created on Sun Nov  4 21:46:51 2018

@author: sk
"""


b =str( input())

a = list(b)



if b[0]==b[1]:
  if b[1]==b[2]:
    print("Yes")
  else :
    print("No")

elif b[1]==b[2]:
  if b[2]==b[3]:
    print("Yes")
  else :
    print("No")
else:
  print("No")
s = input()
t = input()

sset = set(s)
tset = set(t)
slist = list()
tlist = list()

for i in range(len(s)):
   smoji = s[i]
   if s[i] in slist:
      continue
   else:
      si = string(i)
      ss = s.replace(s[i], si)
for i in range(len(t)):
    tmoji = t[i]
    if t[i] in tlist:
      continue
    else:
       ti = string(i)
       ts = t.replace(t[i], ti)

if len(sset) != len(tset):
   print("No")
else:
   if ss != ts:
      print("No")
   else:
      print("Yes")



### FIXED CODE ###

S = input()
T = input()

i = 0
j = 0
ss = list()
tt = list()
slist = list()
tlist = list()

if len(S) == len(T):
   for s in S:
      if s in slist:
         ss.append(slist.index(s))
      else:
         ss.append(i)
         slist.append(s)
         i += 1

   for t in T:
      if t in tlist:
         tt.append(tlist.index(t))
      else:
         tt.append(j)
         tlist.append(t)
         j += 1

   if ss == tt:
      print("Yes")
   else:
      print("No")
else:
   print("No")
L, R = map(int, input().split())
L_mod = L % 2019
R_mod = R % 2019

if R - L >= 2019:
    Ans = 0
elif R_mod < L_mod:
    Ans = 0
elif R_mod > L_mod:
    for i in range(L_mod, R_mod-1):
        Ans = 2019
        Ans = min(Ans,i*(i+1) % 2019)
        
print(Ans)

### FIXED CODE ###

L, R = map(int, input().split())
L_mod = L % 2019
R_mod = R % 2019

if R - L >= 2019:
    Ans = 0
elif R_mod < L_mod:
    Ans = 0
elif R_mod > L_mod:
    Ans = 2019
    for i in range(L_mod, R_mod):
        for k in range(L_mod+1,R_mod+1):
            Ans = min(Ans,i*k % 2019)
        
print(Ans)
n,m,l=[int(i) for i in input().split()]
x=[[int(0) for i in range(m)]for j in range(n)]
z=[[int(0) for i in range(l)]for j in range(n)]
y=[[int(0)for i in range(n)]for j in range(m)]
for i in range(n):
    k=input().split()
    for j in range(m):
        x[i][j]=int(k[j])
for i in  range(m):
    k=input().split()
    for j in range(n):
        y[i][j]=int(k[j])
        
for i in range(n):
    for j in range(l):
        count=int(0)
        for v in range(m):
            count=count+x[i][v]*y[v][j]
        z[i][j]=count
for i in range(n):
    for j in range(n-1):
        print(z[i][j],"",end="")
    print(z[i][n-1])

### FIXED CODE ###

n,m,l=[int(i) for i in input().split()]
x=[[int(0) for i in range(m)]for j in range(n)]
z=[[int(0) for i in range(l)]for j in range(n)]
y=[[int(0)for i in range(l)]for j in range(m)]
for i in range(n):
    k=input().split()
    for j in range(m):
        x[i][j]=int(k[j])
for i in  range(m):
    k=input().split()
    for j in range(l):
        y[i][j]=int(k[j])
        
for i in range(n):
    for j in range(l):
        count=int(0)
        for v in range(m):
            count=count+x[i][v]*y[v][j]
        z[i][j]=count
        
for i in range(n):
    for j in range(l-1):
        print(z[i][j],"",end="")
    print(z[i][l-1])
import sys
 
n,m = map(int, input().split())
sc = [list(map(int, input().split())) for i in range(m)]
 
sc.sort()
ans = 0
d = 0
s = 0
 
if sc[0] == [1, 0]:
  print('-1')
  sys.exit()

if sc[0][0] != 1:
  ans += 10**(n-1)
 
for i in sc:
  if i[0] != d:
    d = i[0]
    s = i[1]
    ans += s * (10 ** (n-d))
  else:
    if i[1] != s:
      print('-1')
      sys.exit()
 
print(ans)

### FIXED CODE ###

import sys

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

num = ['-'] * n

for i in range (m):
  s,c = map(int, input().split())
  if num[s-1] != '-' and num[s-1] != c:
    print('-1')
    sys.exit()
  else:
    num[s-1] = c

if n > 1:
  if num[0] == 0:
    print('-1')
    sys.exit()
  elif num[0] == '-':
    num[0] = 1 
  
for i in range(n):
  if num[i] == '-':
    num[i] = '0'
  else:
    num[i] = str(num[i])

print(''.join(num))
import math
n = input()
a = list(map(int,input().split()))
ans = float("inf")
for i in a:
  ans = min(ans,len(bin(i) - bin(i).rfind("1") - 1)
print(round(ans))

### FIXED CODE ###

import math
n = input()
a = list(map(int,input().split()))
ans = float("inf")
for i in a:
  ans = min(ans,len(bin(i)) - bin(i).rfind("1") - 1)
print(round(ans))
n,a,b,c,d=map(int,input().split())
s=input()
flag=True
for i in range(len(s)-1):
    if s[i]=="#" and s[i+1]=="#":
        flag=False
        break

if c<d:
    if flag:
        print("Yes")
    else:
        print("No")
elif c>d:
    flag=False
    for i in range(b,d+1):
        if s[i-1]=="." and s[i]=="." and s[i+1]==".":
            flag=True
            break
    if flag:
        print("Yes")
    else:
        print("No")


### FIXED CODE ###

N,A,B,C,D=map(int,input().split())
S=input()
A-=1
B-=1
C-=1
D-=1
if "##" in S[A:C+1] or "##" in S[B:D+1]:
    print('No')
else:
    if C<D:
        print('Yes')
    else:
        if "..." in S[B-1:D+2]:
            print('Yes')
        else:
            print('No')
input = int(input())
nums = []
max = 0
total = 0
for x in range(input):
  nums.append(int(input()))
print(int(sum(nums)-max(nums) + max(nums)/2))

### FIXED CODE ###

N = int(input())
p = []
for _ in range(N):
    p.append(int(input()))
 
pmax = max(p)
ans = int(sum(p)-pmax/2)
print(ans)
List = list(map(int,input().split()))
List2 = sorted(List)
print('Yes' if List2[0] + List2[1] == List2[2] else 'No') ) 


### FIXED CODE ###

List = sorted(list(map(int,input().split())))
print('Yes' if List[0] + List[1] == List[2] else 'No')
A, B = map(int, input().split())

import math

g = math.gcd(A, B)
ans = 1

for i in range(2, int(math.sqrt(g))+1):
    if g % i == 0:
        ans += 1
        
        while True:
            g //= i
            if g % i != 0:
                break
                
if (g != 1):
    ans += 1
    
print(ans)

### FIXED CODE ###

A, B = map(int, input().split())

import math

if A < B:
    A, B = B, A
    
while A % B != 0:
    A, B = B, A%B
    
ans = 1

for i in range(2, int(math.sqrt(B))+1):
    if B % i == 0:
        ans += 1
        
        while B % i == 0:
            B //= i
            
if B > 1:
    ans += 1
    
print(ans)
import sys

sys.setrecursionlimit(100000)


def check(i, xs, checked):
    xi = xs[i]
    children = set()
    for j, d in links[i]:
        if checked[j]:
            continue
        if j not in xs:
            xs[j] = xi + d
        elif xi + d != xs[j]:
            return False
        children.add(j)
    checked[i] = True
    return all(check(j, xs, checked) for j in children)


def solve():
    checked = [False] * n
    for i in range(n):
        if not checked[i]:
            xs = {}
            xs[i] = 0
            if not check(i, xs, checked):
                return False
    return True


n, m = map(int, input().split())
links = [set() for _ in range(n)]
for _ in range(m):
    l, r, d = map(int, input().split())
    l -= 1
    r -= 1
    links[l].add((r, d))
    links[r].add((l, -d))
print('Yes' if solve() else 'No')


### FIXED CODE ###

import sys

sys.setrecursionlimit(100000)


def check(i, xs, checked):
    xi = xs[i]
    children = set()
    for j, d in links[i]:
        if checked[j]:
            continue
        if j not in xs:
            xs[j] = xi + d
        elif xi + d != xs[j]:
            return False
        children.add(j)
    checked[i] = True
    for j in children:
        if not check(j, xs, checked):
            return False
    return True


def solve():
    checked = [False] * n
    for i in range(n):
        if not checked[i]:
            xs = {}
            xs[i] = 0
            res = check(i, xs, checked)
            if not res:
                return False
            mn, mx = min(xs.values()), max(xs.values())
            if mx - mn > 1e9:
                return False
    return True


n, m = map(int, input().split())
links = [set() for _ in range(n)]
for _ in range(m):
    l, r, d = map(int, input().split())
    l -= 1
    r -= 1
    links[l].add((r, d))
    links[r].add((l, -d))
print('Yes' if solve() else 'No')
sa = [s for s in input()]
sb = [s fir s in input()]
sc = [s for s in input()]

next_turn = "a"
flag = True

while flag:
    if next_turn == "a":
        if len(sa) == 0:
            print("A")
            flag = False
        else:
            next_turn = sa.pop(0)
    elif next_turn == "b":
        if len(sb) == 0:
            print("B")
            flag = False
        else:
            next_turn = sb.pop(0)
    elif next_turn == "c":
        if len(sc) ==0:
            print("C")
            flag = False
        else:
            next_turn = sc.pop(0)
        



### FIXED CODE ###

sa = list(input())
sb = list(input())
sc = list(input())

turn = "a"

while True:
    if turn == "a":
        if len(sa) != 0:
            turn = sa.pop(0)
        else:
            print("A")
            exit()
    elif turn == "b":
        if len(sb) != 0:
            turn = sb.pop(0)
        else:
            print("B")
            exit()
    else:
        if len(sc) != 0:
            turn = sc.pop(0)
        else:
            print("C")
            exit()
import numpy as np
H,W,K=map(int, input().split())
M=np.array([list(input()) for _ in range(H)])
ans=np.zeros((H,W),int)
k=0

for i in range(H):
    l=0
    for j in range(W):
        if M[i,j]=='#':
            k+=1
            ans[i,l:j+1]=k
            l=j+1

# for i in range(H):
#     if sum(ans[i,:])==0:
#         if i!=0:
#             ans[i,:]=ans[i-1,:]
#         if i==0:
#             ans[i,:]=ans[1,:]
            
for i in range(H):
    for j in range(W):
        if ans[i,j]==0:
            ans[i,j]=ans[i,j-1]
            
            
for j in range(W):
    J=W-j-1
    for i in range(H):
        I=H-i-1
        if ans[I,J]==0:
            ans[I,J]=ans[I+1,J]
            
for row in ans:
    print(*row)

### FIXED CODE ###

import numpy as np
H,W,K=map(int, input().split())
M=np.array([list(input()) for _ in range(H)])
ans=np.zeros((H,W),int)
k=0

for i in range(H):
    l=0
    for j in range(W):
        if M[i,j]=='#':
            k+=1
            ans[i,l:j+1]=k
            l=j+1

            
for i in range(H):
    for j in range(W):
        if ans[i,j]==0:
            ans[i,j]=ans[i,j-1]
            
            
for j in range(W):
    J=W-j-1
    for i in range(H):
        I=H-i-1
        if I!=H-1 and ans[I,J]==0:
            ans[I,J]=ans[I+1,J]


for i in range(H):
    if sum(ans[i,:])==0:
        if i!=0:
            ans[i,:]=ans[i-1,:]
        if i==0:
            ans[i,:]=ans[1,:]
            
for row in ans:
    print(*row)
import sys
sys.setrecursionlimit(100000)
nCr = {}
def cmb(n, r):
    if r == 0 or r == n: return 1
    if r == 1: return n
    if (n,r) in nCr: return nCr[(n,r)]
    nCr[(n,r)] = cmb(n-1,r) + cmb(n-1,r-1)
    return nCr[(n,r)]

X, Y = map(int,input().split())
a=(-X+2*Y)/3
b=(2*X-Y)/3
if a.is_integer()==False or b.is_integer()==False:
    print(0)
else:
    print(cmb(int(a+b),int(b))%(pow(10,9)+7))    

### FIXED CODE ###

p = 1000000007

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

if (X + Y) % 3 != 0:
    print(0)
    exit()

a = (2 * Y - X) // 3
b = (2 * X - Y) // 3

if a < 0 or b < 0:
    print(0)
    exit()

n = a + b
fac = [0] * (n + 1)
fac[0] = 1
for i in range(n):
    fac[i + 1] = fac[i] * (i + 1) % p


def mcomb(n, k):
    if n == 0 and k == 0:
        return 1
    if n < k or k < 0:
        return 0
    return fac[n] * pow(fac[n - k], p - 2, p) * pow(fac[k], p - 2, p) % p


print(mcomb(n, a))
#他者の解答を参考にした
word = input()
for (i in range(len(word))):
  if (word[i] == '?'):
    if (word[i-1] == 'P'):
      word[i] = 'D'
    elif(word[i-1] == 'D'):
      word[i] = 'P'
print(word)

### FIXED CODE ###

word = input()
start = 0
end = len(word)
while(True):
	i = word.find('?', start, end)
	if (i == -1):
		break
	elif (i == (end-1)):
		word = word.replace('?', "D", 1)   
	elif (word[i-1] == 'P'):
		word = word.replace('?', "D", 1)
	elif ((word[i+1] == "?") or (word[i+1] == "D")):
		word = word.replace('?', "P", 1)
	else:
		word = word.replace('?', "D", 1)
	start = i + 1
print(word)
s=input()
n=0
for i in range(4):
    if s[i]==s[i+1]:
        n+=1
    else:
        n+=0
if n>0
    print('Bad')
else:
    print('Good')

### FIXED CODE ###

s=input()
n=0
for i in range(3):
    if s[i]==s[i+1]:
        n+=1
    else:
        n+=0
if n>=1:
    print('Bad')
else:
    print('Good')
n,k = map(int(input().split()))
ab = [list(map(int,input().split()))for i in range(n)]

ab.sort()
c = 0
for i in range(n):
    c += ab[i][1]
    if c >= k:
        print(ab[i][0])
        exit()

### FIXED CODE ###

n,k = map(int, input().split())
ab = sorted([list(map(int,input().split())) for _ in range(n)])
i = 0
c = ab[0][1]
while c < k:
    i += 1
    c += ab[i][1]
print(ab[i][0])
import math
n, m = map(int, input().split())
kotae=1

for i in range(1,int(math.sqrt(m))+1):
  if m%i==0:
    if i*n<=m:
	  kotae=max(kotae,i)
    if (m/i)*n<=m:
      kotae=max(kotae,i)
print(kotae)

### FIXED CODE ###

import math
n, m = map(int, input().split())
kotae=1

for i in range(1,int(math.sqrt(m))+1):
	if m%i==0:
		if i*n<=m:
			kotae=max(kotae, i)
		if (m//i)*n<=m:
			kotae=max(kotae, m//i)
print(kotae)
# -*- coding: utf-8 -*-
"""
Created on Sat Mar 21 13:58:43 2020

@author: 藤原聖士
"""


N=int(input())
A=int(input())
B=int(input())

check=0
checks=0
count=0

for i in range(N):
    checks=0
    Ns=i+1
    while True:
        
        check=Ns%10
        checks+=check
        Ns=int(Ns/10)

        if Ns==0:
            break
    if checks>= A and checks<=B:
        count+=i+1
        print(i)

print(count)

### FIXED CODE ###

# -*- coding: utf-8 -*-
"""
Created on Sat Mar 21 13:58:43 2020

@author: 藤原聖士
"""

"""
N=int(input())
A=int(input())
B=int(input())
"""

N,A,B=map(int,input().split())

check=0
checks=0
count=0

for i in range(N):
    checks=0
    Ns=i+1
    while True:
        
        check=Ns%10
        checks+=check
        Ns=int(Ns/10)

        if Ns==0:
            break
    if checks>= A and checks<=B:
        count+=i+1
        #print(i)

print(count)
from math import gcd
from itertools import combinations

def main():
    k = int(input())
    res = 0
    memo = [[0 for _ in range(k)] for _ in range(k)]
    for i in range(1, k+1):
        for j in range(i, k+1):
            tmp = gcd(i,j)
            memo[i][j] = tmp
            memo[j][i] = tmp

    for i in range(1, k+1):
        res += i 

    for c in combinations(range(1,k+1),2):
        ab = memo[c[0], c[1]]
        res += ab * 6

    for c in combinations(range(1,k+1), 3):
        ab = memo[c[0], c[1]]
        abc = memo[ab, c[2]]
        res += abc * 6
    print(res)


if __name__ == '__main__':
    main()



### FIXED CODE ###

import numpy as np
from itertools import combinations

def main():
    k = int(input())
    res = 0
    memo = np.zeros((k+1, k+1), int)
    for i in range(1, k+1):
        for j in range(i, k+1):
            tmp = np.gcd(i,j)
            memo[i][j] = tmp
            memo[j][i] = tmp

    for i in range(1, k+1):
        res += i 

    for c in combinations(range(1,k+1),2):
        ab = memo[c[0], c[1]]
        res += ab * 6

    for c in combinations(range(1,k+1), 3):
        ab = memo[c[0], c[1]]
        abc = memo[ab, c[2]]
        res += abc * 6
    print(res)


if __name__ == '__main__':
    main()
While True:
    (a, op, b) = input().split()
    a = int(a)
    b = int(b)
    
    if op = '?':
        break
    elif op = '+':
        print(a + b)
    elif op = '-':
        print(a - b)
    elif op = '*':
        print(a * b)
    elif op = '/':
        print(a / b)

### FIXED CODE ###

result = []
while True:
    i = input().split()
    if i[1] == '+':
        result = result +[int(i[0]) + int(i[2])]
    elif i[1] == '-':
        result = result + [int(i[0]) - int(i[2])]
    elif i[1] == '/':
        result = result + [int(int(i[0]) / int(i[2]))]
    elif i[1] == '*':
        result = result + [int(i[0]) * int(i[2])]
    elif i[1] == '?':
        break
for i in result:
    print(i)
N=int(input())
A=1
for i in range(N):
   A=A*int(input())
print(A if A<=100000000000000000 else -1)

### FIXED CODE ###

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

if 0 in As:
    print(0)
else:
    for i in range(N):
        ans*=As[i]
        if ans>int(1e18):
            break
    print(ans if ans<=int(1e18) else -1)
inputData = input().split(' ')
ans = 0

if int(inputData[1]) % input(inputData[0]) ==0:
    ans = int(inputData[0]) + int(inputData[1])
else:
    ans = int(inputData[1]) - int(inputData[0])
print(ans)

### FIXED CODE ###

inputData = input().split(' ')
ans = 0

if int(inputData[1]) % int(inputData[0]) ==0:
    ans = int(inputData[0]) + int(inputData[1])
else:
    ans = int(inputData[1]) - int(inputData[0])
print(ans)
def patterns(start_n, broken_n):
    # start;自分がいる場所，こわれていない．一つ前はこわれている
    diff = broken_n - start_n
    if diff == 1 or diff == 2:
        return 1
    return patterns(start_n, broken_n - 1) + patterns(start_n, broken_n - 2)


inp = input()
split_input = inp.split()
n = int(split_input[0])
m = int(split_input[1])
start = 0
patterns_count = 1
# broken_number = -1
for i in range(m+1):
    if i == m:
        broken = n + 1
    else:
        inp = input()
        broken = int(inp)
    if broken == start:
        # 二つ連続でと通れない
        print(0)
        exit()
    # print(start, broken)
    p = patterns(start, broken)
    patterns_count = patterns_count * p % 1000000007
    start = broken + 1

print(patterns_count)






### FIXED CODE ###

patterns_dictionary = {}
patterns_dictionary[1] = 1
patterns_dictionary[2] = 1


def patterns(start_n, broken_n):
    # start;自分がいる場所，こわれていない．一つ前はこわれている
    diff = broken_n - start_n
    if diff in patterns_dictionary:
        return patterns_dictionary[diff]
    for ii in range(len(patterns_dictionary)+1, diff+1):
        patterns_dictionary[ii] = patterns_dictionary[ii-1] + patterns_dictionary[ii-2]
    ans = patterns(start_n, broken_n - 1) + patterns(start_n, broken_n - 2)
    patterns_dictionary[diff] = ans
    return ans


inp = input()
split_input = inp.split()
n = int(split_input[0])
m = int(split_input[1])
start = 0
patterns_count = 1
# broken_number = -1
for i in range(m+1):
    if i == m:
        broken = n + 1
    else:
        inp = input()
        broken = int(inp)
    if broken == start:
        # 二つ連続で通れない
        print(0)
        exit()
    # print(start, broken)
    p = patterns(start, broken)
    patterns_count = (patterns_count * p) % 1000000007
    start = broken + 1

print(patterns_count)
N = int(input())
array = list(map(int, input().strip().split()))
array.sort()
ans = 0
a = [True] * array[N-1]
i = 0
before = 0
for i in array:
    j = 2*i
    if i == before:
        array[i] == False
    while j < array[N-1]:
        array[j] == False
        j += i
    before = i
for i in array:
    if array[i] == True:
        ans += 1
print(ans)

### FIXED CODE ###

N = int(input())
array = list(map(int, input().strip().split()))
array.sort()
ans = 0
a = [True] * (10**6 + 1)
i = 0
before = 0
for i in array:
    if a[i] == True:
        j = 2*i
        if i == before:
            a[i] = False
        while j <= array[N-1]:
            a[j] = False
            j += i
        before = i
for i in array:
    if a[i] == True:
        ans += 1
print(ans)
a=input();print('YNeos'[2<len({*a})or a[1]!=a[2]::2])

### FIXED CODE ###

n=list(input());print("YNeos"[1-(n[0]==n[1]==n[2] or n[1]==n[2]==n[3])::2])
= map(int,input().split())
l = list(map(int,input().split()))
s = 0
for i in range(n):
  s += l[i]
print(max(m-s,-1))

### FIXED CODE ###

m,n = map(int,input().split())
l = list(map(int,input().split()))
s = 0
for i in range(n):
  s += l[i]
print(max(m-s,-1))