Harryxun/stf_run huggingface dataset:
#!/mnt/c/Users/moiki/bash/env/bin/python
N,K = map(int, input().split())
A = [ [int(j) for j in input().split()] for i in range(N)]
# I = [ [j for j in range(1,N+1) if Ai[j]] for Ai in A]
MOD = 10**9 + 7

# dp = [0] * (N+1)
dp = [ [0] * (N+1) for _ in range(N+1)]

import numpy as np
npA = np.array(A).astype(np.uint64)

def prod2(A,B):
    global N
    C = [ [0]*N for _ in range(N)]
    for i in range(N):
        for j in range(N):
            tmp = 0
            for k in range(N):
                tmp += A[i][k] * B[k][j]
            C[i][j] = tmp
    return C


def prod(A,n):
    if n == 0:
        C = [ [0]*(N) for _ in range(N)]
        for i in range(N):
                C[i][i] = 1
        return C

    elif n == 1:
        return A

    elif n % 2 == 1:
        return prod2( A , prod(A,n-1))

    elif n % 2 == 0:
        return prod2( prod(A,n//2), prod(A,n//2))
    
    

ans = 0
# M = np.linalg.matrix_power(A, K)
M = prod(A,K)
for i in range(1,N+1):
    for j in range(1,N+1):
        # dp[i][j] = np.linalg.matrix_power(A, K)[i-1][j-1].item()
        # ans += dp[i][j] % MOD
        # ans += np.linalg.matrix_power(A, K)[i-1][j-1].item() % MOD
        # ans += M[i-1,j-1].item() % MOD
        ans += M[i-1][j-1] % MOD

print(ans%MOD)



### FIXED CODE ###

#!/mnt/c/Users/moiki/bash/env/bin/python
N,K = map(int, input().split())
A = [ [int(j) for j in input().split()] for i in range(N)]
# I = [ [j for j in range(1,N+1) if Ai[j]] for Ai in A]
MOD = 10**9 + 7

# dp = [0] * (N+1)
dp = [ [0] * (N+1) for _ in range(N+1)]

S = [[1]*N]
KDIG = [0]*70

for i in range(1,61):
    if K % (1<<i) :
        KDIG[i-1] = 1
        K -= K%(1<<i)


def prod(A,B,k,l,m):#A:k*l,B:l*m
 
    C=[[None for i in range(m)] for j in range(k)]
 
    for i in range(k):
        for j in range(m):
            ANS=0
            for pl in range(l):
                ANS=(ANS+A[i][pl]*B[pl][j])%MOD
 
            C[i][j]=ANS
 
    return C



for i in range(60):
    if KDIG[i] == 1:
        S = prod(S,A,1,N,N)

    A = prod(A,A,N,N,N)
print(sum(S[0])%MOD)

# for i in range(1,N+1):
#     for j in range(1,N+1):
#         # dp[i][j] = np.linalg.matrix_power(A, K)[i-1][j-1].item()
#         # ans += dp[i][j] % MOD
#         # ans += np.linalg.matrix_power(A, K)[i-1][j-1].item() % MOD
#         # ans += M[i-1,j-1].item() % MOD
#         ans += M[i-1][j-1] % MOD

# print(ans%MOD)
from itertools import accumulate

def S(a, b):
    return cl[b] - (0 if a == 0 else cl[a-1])

if __name__ == '__main__':
    # read input
    n = int(input())
    l = list(map(int, input().split()))
    # create cumlative list first
    cl = list(accumulate(l))
    clen = len(l)

    #  0  F(i)      i i+1 G(i)      len-1
    #  |------|------|-------|-------|
    #         c0    c1       c2
    #  <-----L------> <------R------->
    # pick up a c1 (i:i+1) and evaluate
    r = list()
    result = None
    for i in range(1,clen-2):
        #print("i={}\tL{}, R{}".format(i, l[0:i+1], l[i+1:]))

        # find C0 for each i
        odiff = 10000000000
        for c in range(i):
            B = S(0,c)
            C = S(c+1,i)
            diff1 = abs(B-C)
            if odiff < diff1:
                break
            odiff = diff1
            mb = B
            mc = C

        # find C2 for each i
        odiff = 10000000000
        for c in range(i+1,clen-1):
            D = S(i+1, c)
            E = S(c+1, clen-1)
            diff2 = abs(E-D)
            if odiff < diff2:
                break
            odiff = diff2
            md = D
            me = E

        # evaluate
        diff = abs(max(mb, mc, md, me) - min(mb, mc, md, me))
        if result is None:
            result = diff
        else:
            if result > diff:
                result = diff

    print(result)

### FIXED CODE ###

from itertools import accumulate

def Sdiff(s, m, e):
    # Sdiff(s, m, e) = [A_s, A_s+1 ..., A_m] [A_m+1 .... A_e]
    #    L = cl[m]-cl[s-1], R = cl[e] - cl[m]
    # diff(L,R) = abs(cl[m] - cl[s-1] - cl[e] + cl[m]) = abs(2*cl[m] - cl[s-1] - cl[e])

    x = 0 if s == 0 else cl[s-1]
    return abs(2*cl[m] - x - cl[e])

def partial(start, end, last):
    #print("partial: {}-{} last:{}".format(start,end, last))
    odiff = Sdiff(start, last, end)

    for c in range(last, end):
        diff = Sdiff(start, c, end)
        #print("partial loop: c:{}, diff:{} -> {}".format(c, odiff, diff))
        if odiff < diff:
            return c-1
        odiff = diff
    return c

if __name__ == '__main__':
    # read input
    N = int(input())
    l = list(map(int, input().split()))
    # create cumlative list first
    cl = list(accumulate(l))

    #  0  F(i)      i i+1 G(i)      len-1
    #  |------|------|-------|-------|
    #         c0    c1       c2
    #  <-----L------> <------R------->
    # pick up a c1 (i:i+1) and evaluate
    result = 9 * 10e9
    c1 = 0
    c3 = 2
    for i in range(1, N-2):
        #print("LEFT:RIGHT {}/={}=/{}".format(l[0:i+1], i, l[i+1: N]))
        # LEFT
        c1 = partial(0, i, c1)
        # RIGHT
        c3 = partial(i+1, N-1, c3)

        # evaluate
        mb = cl[c1]
        mc = cl[i] - mb
        md = cl[c3] - cl[i]
        me = cl[N-1] - cl[c3]
        diff = abs(max(mb, mc, md, me) - min(mb, mc, md, me))
        #print("\t\t{}/{}/{}: [{} {} {} {}]".format(c1, i, c3, mb, mc, md, me))
        #print("\t\tdiff={}".format(diff))
        if diff < result:
            result = diff

    print(result)
n,k = map(int, input().split())
d = []
A= []
c = []
 
for i in range(k):
    d.append(int(input()))
    a = input()
    A.append([int(a[j]) for j in range(a)])
 
for j in range(k):
    for m in range(d[j]):
        c.append(A[j][m])
 
print(n-len(set(c)))

### FIXED CODE ###

n,k = map(int, input().split())
d = []
A= []
c = []
 
for i in range(k):
    d.append(int(input()))
    A.append(list(map(int, input().split())))
 
for j in range(k):
    for m in range(d[j]):
        c.append(A[j][m])
 
print(n-len(set(c)))
a, b = map(int,input.split())
if a == b:
  print("Yes")
  else:
    print("No")

### FIXED CODE ###

a, b = map(int, input().split())
if a == b:
  print("Yes")
else:
  print("No")
x1 = list(map(int,input().rstrip().split(" ")))
x2 = list(map(int,input().rstrip().split(" ")))

def makey(x1,x2):
  total = 0
  for i in range(x1[0]):
    total += x2[i]
    if total > x1[1]:
      return i
    return i
y = makey(x1,x2)
print(y+1)


### FIXED CODE ###

y = list(map(int,input().rstrip().split(" ")))
X,A = y[0],y[1]
if X < A:
  print(0)
else:
  print(10)
import math
def C(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))
n, a, b, k = map(int, input().split())
count = 0
for i in range(math.floor(k/a)):
    if (k - (i * a)) % b == 0:
        count += (C(n, i) * C(n, (k-a*i)/b))
print(count%998244353)

### FIXED CODE ###

N,A,B,K = map(int,input().split())
sprime = 998244353 # approx 10**9
A,B = sorted((A,B))
if (A+B) * N < K:
	print(0)
	exit()
 
def egcd(a, b):
    if a == 0:
        return (b, 0, 1)
    else:
        g, y, x = egcd(b % a, a)
        return (g, x - (b // a) * y, y)
 
def modinv(a, m):
    g, x, y = egcd(a, m)
    if g != 1:
        raise Exception('modular inverse does not exist')
    else:
        return x % m
 
memo = [0] * (N+1)
memo[0] = memo[N] = 1
for i in range(1,N//2+1):
	v = memo[i-1] * (N-i+1) * modinv(i,sprime)
	v = v % sprime
	memo[i] = memo[N-i] = v
 
# max is A*N + B*N
sum = 0
for b in range(N+1):
  a = (K-b*B)//A
  if 0 <= a <= N and a*A+b*B == K:
    sum += memo[a]*memo[b]
    sum %= sprime
 
print(sum)
A=input()
B=input()
C=input()
if A[-1]==B[0] and B[-1]==C[0]:
    print("YES")
else:
    print("NO")

### FIXED CODE ###

A,B,C=map(str,input().split())
if A[-1]==B[0] and B[-1]==C[0]:
    print("YES")
else:
    print("NO")
import numpy as np
N=int(input())
A = np.array(list(map(int, input().split())))
X = A+np.arange(N)+1
S = A*(-1)+np.arange(N)+1
Ans=0
for i in range(N):
    Ans += np.count_nonzero(S[i:] == X[i])
print(Ans)

### FIXED CODE ###

S=input()
if S=='ABC':
    print('ARC')
else:
    print('ABC')
output = []
 
for (i, x) in enumerate(S):
    if i == 0:
        pre = x
    else:
        if pre == x:
            output = "Bad"
            print(output)
        pre = x
            
if len(output) > 0:
    print(output)
else:
    output = "Good"
    print(output)

### FIXED CODE ###

output = []
 
for (i, x) in enumerate(input()):
    if i == 0:
        pre = x
    else:
        if pre == x:
            output = "Bad"
        pre = x
            
if len(output) > 0:
    print(output)
else:
    output = "Good"
    print(output)
import math




N=int(input())

anslist=[0]*(N+1)
ma=int(math.sqrt(N/2))+1
for x in range(1,ma):
    for y in range(x,ma):
        for z in range(y,ma):
            n=x**2+y**2+z**2+x*y+y*z+z*x
            if n <=N:
                if x==y and y==z:
                    anslist[n+1]+=1
                elif x==y or y==z or z==x:
                    anslist[n+1]+=3
                else:
                    anslist[n+1]+=6

            

for i in range(1,N+1):
    print(anslist[i])

### FIXED CODE ###

import math




N=int(input())

anslist=[0]*(N+1)
ma=int(math.sqrt(N))+1
for x in range(1,ma):
    for y in range(x,ma):
        for z in range(y,ma):
            n=x**2+y**2+z**2+x*y+y*z+z*x
            if n <=N:
                if x==y and y==z:
                    anslist[n]+=1
                elif x==y or y==z or z==x:
                    anslist[n]+=3
                else:
                    anslist[n]+=6

            
for i in range(1,N+1):
    print(anslist[i])
import sys
from collections import defaultdict as dd
input = sys.stdin.readline
N = int(input())
e = dd(list)
for i in range(N - 1):
  a, b = tuple(map(int, input().split()))
  e[a].append((b, i))
  e[b].append((a, i))
res = [0] * (N - 1)
vis = set()
def dfs(x):
  global vis
  global res
  viss = set()
  t = 1
  for y, i in e[x]:
    if i in vis: viss.add(res[i])
  for y, i in e[x]:
    if i in vis:
      while t in viss:
        t += 1
      continue
    vis.add(i)
    res[i] = t
    t += 1
    dfs(y)
dfs(1)
print(max(res))
for r in res: print(r)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 7)
from collections import defaultdict as dd
input = sys.stdin.readline
N = int(input())
e = dd(list)
for i in range(N - 1):
  a, b = tuple(map(int, input().split()))
  e[a].append((b, i))
  e[b].append((a, i))
res = [0] * (N - 1)
vis = set()
def dfs(x):
  global vis
  global res
  viss = set()
  svis = set()
  t = 1
  for y, i in e[x]:
    if i in vis: viss.add(res[i])
  #print(x, viss)
  for y, i in e[x]:
    #print(x, y, t)
    while t in viss:
      t += 1
    if i in vis:
      continue
    #print(x, y, t)
    svis.add(y)
    vis.add(i)
    res[i] = t
    t += 1
  for y in svis:
    dfs(y)
  #print(res)
dfs(1)
print(max(res))
for r in res: print(r)
n,k=map(int,input().split())
h=list(map(int,input().split()))
dp=[10**9]*n

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

### FIXED CODE ###

n,k=map(int,input().split())
h=list(map(int,input().split()))
dp=[10**9]*n

dp[0]=0
for i in range(1,n):
    for j in range(1,min(k+1,i+1)):
        dp[i]=min(dp[i],dp[i-j]+abs(h[i]-h[i-j]))
    
print(dp[n-1])
s=input()
t=input()
if s==t(:-1):
  print("Yes")
else:
  print("No")

### FIXED CODE ###

s=input()
t=input()
if s==t[:-1]:
  print("Yes")
else:
  print("No")
import numpy as np

n, q = map(int, input().split())
edges=[[] for i in range(n+1)]
d_from_1=[-1 for i in range(n+1)]
ans = [0 for i in range(n+1)]

for i in range(1,n):
	a, b=[int(i) for i in input().split()]
	edges[a].append([b,1])
	edges[b].append([a,1])
def kyori_from_1(u):
	for v,w in edges[u]:
		if d_from_1[v]==-1:
			d_from_1[v]=d_from_1[u]+w
			kyori_from_1(v)

d_from_1[1]=0
kyori_from_1(1)

px = []
for i in range(q):
    p, x = map(int, input().split())
    px.append([p, x])


d_from_p = [-1 for i in range(n+1)]
def kyori_from_p(u):
	for v,w in edges[u]:
		if d_from_p[v]==-1:
			d_from_p[v]=d_from_p[u]+w
			kyori_from_p(v)

for i in range(q):
    d_from_p = [-1 for i in range(n+1)]
    d_from_p[px[i][0]] = 0
    kyori_from_p(px[i][0])
    for j in range(1, n+1):
        if px[i][0] == 1:
            ans[j] += px[i][1]
        elif d_from_1[j] >= d_from_1[px[i][0]] and d_from_p[j] < d_from_1[j]:
            ans[j] += px[i][1]

ans.pop(0)
print(' '.join(map(str, ans)))

### FIXED CODE ###

n, q = map(int, input().split())
edges=[[] for i in range(n+1)]
for i in range(1,n):
	a, b=[int(i) for i in input().split()]
	edges[a].append(b)
	edges[b].append(a)
c = [0 for i in range(n+1)]
for i in range(q):
    p, x = map(int, input().split())
    c[p] += x

ind = [0 for i in range(n+1)]
ind[1] = 1
nxt = [1]
nxt_copy = []
while nxt != []:
    for i in nxt:
        for j in edges[i]:
            if ind[j] == 0:
                ind[j] = 1
                c[j] += c[i]
                nxt_copy.append(j)
    nxt = nxt_copy.copy()
    nxt_copy = []

c.pop(0)
print(' '.join(map(str, c)))
import sys
d={}
for e in sys.stdin.readlines()[1:]:
 if'f'==e[0]:
　print('yes'if e[5:]in d else'no')
 else:
　d[e[7:]]=0


### FIXED CODE ###

import sys
def m():
 d={};input()
 for e in sys.stdin:
  if'f'==e[0]:print(['no','yes'][e[5:]in d])
  else:d[e[7:]]=0
if'__main__'==__name__:m()
n, k = map(int, input().split())
l = list(map(int, input().split()))
 
tmp = l[:k]
now = tmp
 
for i in range(n-k):
  tmp -= l[i]
  tmp += l[i+k]
  now = max(tmp, now)
  
print((now + k) / 2)

### FIXED CODE ###

n, k = map(int, input().split())
l = list(map(int, input().split()))
 
tmp = sum(l[:k])
now = tmp
 
for i in range(n-k):
  tmp -= l[i]
  tmp += l[i+k]
  now = max(tmp, now)
  
print((now + k) / 2)
N, K = map(int, input().split())

XY = []
for _ in range(N):
    x, y = map(int, input().split())
    XY.append((x, y))
    
    
import numpy as np
dots = np.asarray(XY[:])

import sys
INT_MAX = sys.maxsize

ans = INT_MAX

import itertools
for ((left_x, _), (right_x, _)) in itertools.combinations(dots, 2):
    if left_x > right_x:
        left_x, right_x = right_x, left_x
    for ((_, under_y), (_, top_y)) in itertools.combinations(dots, 2):
        if under_y > top_y:
            under_y, top_y = top_y, under_y
        counter = 0
        for d_x, d_y in dots:
            if  (left_x <= d_x) and (d_x <= right_x) and (under_y <= d_y) and (d_y <= top_y):
                counter += 1
                
        if counter >= K:
            area = (top_y-under_y) * (right_x-left_x)
            if ans > area:
                ans = area
            
print(ans)


### FIXED CODE ###

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

XY = []
for _ in range(N):
    x, y = map(int, input().split())
    XY.append((x, y))
    
dots = XY[:]

import sys
INT_MAX = sys.maxsize

ans = INT_MAX

import itertools
for ((left_x, _), (right_x, _)) in itertools.combinations(dots, 2):
    if left_x > right_x:
        left_x, right_x = right_x, left_x
    for ((_, under_y), (_, top_y)) in itertools.combinations(dots, 2):
        if under_y > top_y:
            under_y, top_y = top_y, under_y
        counter = 0
        for d_x, d_y in dots:
            if  (left_x <= d_x) and (d_x <= right_x) and (under_y <= d_y) and (d_y <= top_y):
                counter += 1
                
        if counter >= K:
            area = (top_y-under_y) * (right_x-left_x)
            if ans > area:
                ans = area
            
print(ans)
H,W = int(input().split())

for y in range(0,H):
	for x in range(0,W):
		print('#')



### FIXED CODE ###

while True:	
	H,W = map(int, input().split())
	if H==0 and W==0: break
	for y in range(0,H):
		for x in range(0,W):
			print("#",end="")
			
		print()
	print()
def get_answer(ki):
    n = int(ki[0].split(" ")[0])
    q = int(ki[0].split(" ")[1])
    n_data = [[int(k[0]), int(k[1])] for k in [k.split(" ") for k in ki[1:-q]]]
    q_data = [[int(k[0]), int(k[1])] for k in [k.split(" ") for k in ki[-q:]]]
    tree = make_tree(n, n_data)

    score = [0] * n

    for qq in q_data:
        index = qq[0]
        add_score(tree, score, qq, n_data, index)

    #score = [str(s) for s in score]
    #s = " ".join(score)
    for s in score:
        print(s, end="")
        print(" ", end="")

    return None


def add_score(tree, score, qq, n_data, index):
    score[index - 1] += qq[1]
    next_index = tree[index -1]
    for n_i in next_index:
        add_score(tree, score, qq, n_data, n_i)


def make_tree(n, n_data):
    r = {}
    for i in range(n):
        r[i] = []
    for n in n_data:
        k = n[0] - 1
        if k in r.keys():
            r[k].append(n[1])
        else:
            r[k] = [n[1]]
    return r


def make_index(n, tree):
    index = {}
    r0 = [0] * n
    for i in range(n):
        r0[i] = i
    index[0] = r0

    for i in range(1, n):
        r = []
        add_index(tree, i, r)
        index[i] = r

    return index


def add_index(tree, index, r):
    r.append(index)
    next_index = tree[index]
    for n_i in next_index:
        add_index(tree, n_i - 1, r)


if __name__ == "__main__":
    input_ki = []
    while True:
        try:
            input1 = input()
            if not input1:
                break;
            if len(input1) == 0:
                break;
            input_ki.append(input1)
        except EOFError:
            break
    get_answer(input_ki)


### FIXED CODE ###



def get_answer(a, s):
    a = int(a)
    if a >= 3200:
        return s
    return "red"


if __name__ == "__main__":
    input1 = input()
    input2 = input()
    print(get_answer(input1, input2))
stairs = int(input())
stair_status = list(map(int,input().split(" ")))

count = []
for i in range(stairs-1):
    if i == 0:
        for j in range(stairs):
            if stair_status[i+j]<stair_status[i+j+1]:
                #print(stair_status[i+j+1])
                count.append(j)
                skip = j+1
                break
            else:
                if (i + j + 2)==stairs:
                    count.append(j+1)
                    break
        if (i + j + 2)==stairs:
            break
        
        if max(count)>=stairs-max(count):
            break
    if skip == 0:
        for j in range(stairs):
            if stair_status[i+j]<stair_status[i+j+1]:
                #print(stair_status[i+j+1])
                count.append(j)
                skip.append(j+1)
                break
            else:
                if (i + j + 2)==stairs:
                    count.append(j+1)
                    break
        if (i + j + 2)==stairs:
            break
        
        if max(count)>=stairs-max(count):
            break
    else:
        skip -= 1
print(max(count))

### FIXED CODE ###

stairs = int(input())
stair_status = list(map(int,input().split(" ")))

move = 0
count = [0]
for i in range(stairs-1):
    if stair_status[i]>=stair_status[i+1]:
        move += 1
        count.append(move)
    else:
        count.append(move)
        move = 0  #reset
    
else:
    print(max(count))
1 X = list(map(int, input().split()))

print(X[0]*X[1])

### FIXED CODE ###

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

print(X[0]*X[1])
H, W = map(int, input().split())
matrix = [str(input()) for i in range(H)]


matrix_1 = []
for i in range(H):
    if matrix[i] != "." * W:
        matrix_1.append(matrix[i])


matrix_2 = []
for i in range(W):
    a = ""
    for l in range(len(matrix_1)):
        a += matrix_1[l][i]
    matrix_2.append(a)


ans = []
k = len(matrix_1)
for i in range(W):
    if matrix_2[i] != "." * k:
        ans.append(matrix_2[i])


ans_2 = []
for i in range(len(ans)):
    a = ""
    for l in range(len(ans[0])):
        a += ans[l][i]
    ans_2.append(a)


for i in range(len(ans_2)):
    print(ans_2[i])

### FIXED CODE ###

H, W = map(int, input().split())
matrix = [str(input()) for i in range(H)]


matrix_1 = []
for i in range(H):
    if matrix[i] != "." * W:
        matrix_1.append(matrix[i])


matrix_2 = []
for i in range(W):
    a = ""
    for l in range(len(matrix_1)):
        a += matrix_1[l][i]
    matrix_2.append(a)


ans = []
k = len(matrix_1)
for i in range(W):
    if matrix_2[i] != "." * k:
        ans.append(matrix_2[i])


ans_2 = []
for i in range(len(ans[0])):
    a = ""
    for l in range(len(ans)):
        a += ans[l][i]
    ans_2.append(a)


for i in range(len(ans_2)):
    print(ans_2[i])
import numpy as np

n = int(input())
a = list(map(int, input().split()))
sum = 0
for i in range(len(a)-1):
    for j in range(i+1,len(a)):
        sum += a[i]*a[j]
        
ans = np.mod(sum,10**9+7)

print(ans)

### FIXED CODE ###


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

MOD = 10 ** 9 + 7

sum = sum(a) % MOD
ans = 0

for i in range(len(a)):
    sum -= a[i]
    sum %= MOD
    ans += a[i] * sum
    ans %= MOD

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

ans = [0 for i in range(M)]

for i in range(N):
    tmp = list(map(int, input().split()))
    for j in range(tmp[0]):
        ans[tmp[j]]+=1
        
now = 0
        
for i in range(M):
    if ans[i]==N:
        now+=1
        
print(now)

### FIXED CODE ###

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

ans = [0 for i in range(M)]

for i in range(N):
    tmp = list(map(int, input().split()))
    for j in range(tmp[0]):
        ans[tmp[j+1]-1]+=1
        
now = 0
        
for i in range(M):
    if ans[i]==N:
        now+=1
        
print(now)
n, m, x, y = map(int, input().split())

xl = list(map(int, input().split()))
yl = list(map(int, input().split()))

xmax = sorted(x, key=None ,reverse=True)[0]
ymin = sorted(y)[0]

if max(x + xl) < min(y + yl):
    print("No War")
else:
    print("War")

### FIXED CODE ###

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

xl = list(map(int, input().split()))
yl = list(map(int, input().split()))

if max(xl + [x]) < min(yl + [y]):
    print("No War")
else:
    print("War")
import sys
import os
import math

def file_input():
    f = open('../Beginner_Contest_165/input.txt', 'r')
    sys.stdin = f

def main():
    #file_input()
    # input()
    A,B,N=map(int, input().split())

    max=0
    # for x in range(N+1):
    #     # ans=int(A*x/B)-A*int(x/B)
    #     min,_=math.modf(x/B)
    #     # ans=int(A*min)
    #     # print(min)
    #     if x==0:
    #         max=min
    #     elif min > max:
    #         max=min
    #     else:
    #         break

    max=0
    max_x=0
    reg=[0]*10

    for x in range(N+1):
        rem = x%B
        if reg[rem]==1:
            break
        else:
            reg[rem]=1
        if rem > max:
            rem = max
            max_x=x

    min,_=math.modf(max_x/B)

    print(int(min*A))

if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
import os

def file_input():
    f = open('../Beginner_Contest_165/input.txt', 'r')
    sys.stdin = f

def main():
   # file_input()
    # input()
    A,B,N=map(int, input().split())

    max=0
    # for x in range(N+1):
    #     # ans=int(A*x/B)-A*int(x/B)
    #     min,_=math.modf(x/B)
    #     # ans=int(A*min)
    #     # print(min)
    #     if x==0:
    #         max=min
    #     elif min > max:
    #         max=min
    #     else:
    #         break

    # max=0
    # max_x=0
    # first=0
    #
    # for x in range(N+1):
    #     rem = x%B
    #     if x == 0:
    #         first=rem
    #     elif rem == first:
    #         break
    #     if rem > max:
    #         max=rem
    #         max_x=x

    if N<B:
        max_x=N
    else:
        max_x=B-1

    # min,_=math.modf(max_x/B)

    print(int(A*max_x/B)-A*int(max_x/B))

if __name__ == '__main__':
    main()
import numpy as np

N = int(input())
A = [map(int, input().split())]
A.sort()

ans = 0
if(A[0] == 0):
    ans = 0
else:
    ans = np.prod(x)

if ans >= 1e18:
    print('-1')
else:
    print(f'{ans}')

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
MAX = 1e18

A.sort()

ans = 1
for i in A:
    ans *= i
    if ans > MAX:
        ans = -1
        break

print(ans)