Harryxun/stf_run huggingface dataset:
import heapq
def SME(start,end):
    count = 0
    for i,x in enumerate(Whole[start:end//2]):
        heapq.heappush(A,[x,i])
    for j in range(start,end):
        a = heapq.heappop(A)
        if None not in ANS[a[1]:a[1]+L] : continue
        for i in range(L):
            idx = a[1] + i
            try :
                if ANS[idx] : continue
                else :
                    ANS[idx] = a[0]
                    count += 1
            except IndexError : continue
        if count > N * parameter : break
    for i in range(L):
        if ANS[i] : continue
        else : ANS[i] = min(Whole[:i+1])
    i = L
    while i < N :
        if None in ANS[i:i+L] :
            while True:
                if ANS[i] :
                    i += 1
                    continue
                else : 
                    ANS[i] = min(Whole[i+1-L:i+1])
                    i += 1
                    break
        else :
            i += L
    return ANS
[N,L] = [int(x) for x in input().split()]
Whole = [int(x) for x in input().split()]
A = []
parameter = 0.99
ANS = [None]*N
ANS = SME(0, N)
for i in ANS[L-1:-1]:print(i, end=" ")
print(ANS[-1])

### FIXED CODE ###

def ascend(a,b):
    mini = min(A[a:a+L])
    ans[a] = mini
    for i in range(a+1,b):
        if A[i+L-1] <= mini : mini = A[i+L-1]
        elif A[i-1] == mini : mini = min(A[i:i+L])
        ans[i] = mini

def descend(a,b):
    mini = min(A[b-1:b+L-1])
    ans[b-1] = mini
    for i in range(b-2,a-1,-1):
        if A[i] <= mini : mini = A[i]
        elif A[i+L] == mini: mini = min(A[i:i+L])
        ans[i] = mini
    
[N,L] = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
ans = [None]*(N-L+1)
count = 0;
if N > 10 ** 4:
    for i in range(100):
        if A[i+1] > A[i] : count += 1
    if count > 80 : descend(0, N-L+1)
    else : ascend(0,N-L+1)
else :
    ascend(0, N-L+1)
for i in ans[:-1] : print(i, end=" ")
print(ans[-1])
N = int(input())
T = list(map(int,input().split()))
A = list(map(int,input().split()))
T_min = [0]*N
T_min[0] = T[0]
for i in range(1,N):
  if T[i-1]<T[i]:
    T_min[i] = T[i]
A_min = [0]*N
A_min[N-1] = A[N-1]
for i in range(N-2,-1,-1):
  if A[i+1]<A[i]:
    A_min[i] = A[i]
M = [0]*N
M_min = [0]*N
for i in range(N):
  M = min(T[i],A[i])
  M_min = max(T_min[i],A_min[i])
ans = 1
mod = 10**9+7
for i in range(N):
  if M[i]<M_min[i]:
    ans = 0
  else:
    ans*=M[i]+1-M_min[i]
    ans%=mod
print(ans)



### FIXED CODE ###

N = int(input())
T = list(map(int,input().split()))
A = list(map(int,input().split()))
T_min = [1]*N
T_min[0] = T[0]
for i in range(1,N):
  if T[i-1]<T[i]:
    T_min[i] = T[i]
A_min = [1]*N
A_min[N-1] = A[N-1]
for i in range(N-2,-1,-1):
  if A[i+1]<A[i]:
    A_min[i] = A[i]
M = [0]*N
M_min = [0]*N
for i in range(N):
  M[i] = min(T[i],A[i])
  M_min[i] = max(T_min[i],A_min[i])
ans = 1
mod = 10**9+7
for i in range(N):
  if M[i]<M_min[i]:
    ans = 0
  else:
    ans*=M[i]+1-M_min[i]
    ans%=mod
print(ans)
n=int(input())
a=list(map(int,input().split()))
a=sorted(a)
dp=[True]*a[-1]
for i in a:
  for j in range(i,a[-1]):
    if j%i==0:
      dp=False
cnt=0
for i in a:
  if dp[i]:
    cnt+=1
print(cnt)

### FIXED CODE ###

def sieve(n=10**6):
  p=[-1]*(n+1)
  for i in a:
    if p[i]==-1:
      p[i]=1
      for j in range(2*i,n+1,i):p[j]=0
    elif p[i]==1:
      p[i]=0
  return p
n=int(input())
a=sorted(list(map(int,input().split())))
p=sieve()
ans=0
for i in a:
  ans+=p[i]
print(ans)
import heapq as hq
n,m=input().split()
hq.heapify(a:=[-int(x) for x in input().split()])
for i in range(int(m)):hq.heappush(a,-(-hq.heappop(a)//2))
print(-sum(a))

### FIXED CODE ###

n,k,q = map(int,input().split())
pts = [0]*(n+1)
for _ in range(q):
  a = int(input())
  pts[a] += 1
ans = [k+a-q for a in pts]
for v in ans[1:]:
  print('Yes' if v>0 else 'No')
l = list(map(int, input().split()))
a = []
while(l != []):
    length =len(str(l[0]+l[1]))
    a.append(length)
    l = list(map(int, input().split()))

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


### FIXED CODE ###

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

while(l != []):
    try:
        length = len(str(l[0]+l[1]))
        print(length)
        l = list(map(int, input().split()))
    except:
        break
if int(input())>8 or int(input())>8:
  print(":(")
else:
  print("Yay!")

### FIXED CODE ###

if max(list(map(int,input().split()))) >8:
  print(":(")
else:
  print("Yay!")
input_data = input().split("\n")
N = int(input_data[0])
ls = [int(b) for b in input_data[1].split()]
if len(ls) == 1:
  print(ls[0]*2)
else:
  first = ls[0]
  als = [ls[0]]

  for n in range(1, N-1):
    als.append(min(ls[n-1], ls[n]))
  als.append(ls[-1])
  print(sum(als))

### FIXED CODE ###

N = int(input())
ls = [int(i) for i in input().split()]
if len(ls) == 1:
  print(ls[0]*2)
else:
  als = [ls[0]]
  for n in range(1, N-1):
    als.append(min(ls[n-1], ls[n]))
  als.append(ls[-1])
  print(sum(als))
from time import time
start = time()

# 解説放送の解法

class BIT:
    '''https://tjkendev.github.io/procon-library/python/range_query/bit.html'''
    def __init__(self, n):
        self.n = n
        self.data = [0]*(n+1)
        self.el = [0]*(n+1)
    def sum(self, i):
        s = 0
        while i > 0:
            s += self.data[i]
            i -= i & -i
        return s
    def add(self, i, x):
        self.el[i] += x
        while i <= self.n:
            self.data[i] += x
            i += i & -i
    def query(self, i, j=None):
        if j is None:
            return self.el[i]
        return self.sum(j) - self.sum(i)
      
def main():
  N,Q=map(int,input().split())
  *C,=map(int,input().split())

  # 重複度を数える。
  res=[]
  tmp_dict={}
  for i in range(N):
    if tmp_dict.get(C[i]) != None:
      #(クエリの種類、l, r）
      res.append((-1,tmp_dict[C[i]],i))
      del tmp_dict[C[i]]
    tmp_dict[C[i]] = i
    
  assert time() - start < 0.1

  # クエリと合わせてソート。
  X = []
  for i in range(Q):
    l,r = map(int,input().split())
    # (元のクエリの順番、l, r)
    X.append((i,l-1,r-1))

  #assert time() - start < 0.8
    
  X.extend(res) 
  X = sorted(X,key=lambda x:(x[1],-x[0]))
  
  #assert time() - start < 0.5

  # 平面走査
  bit = BIT(N)
  ans=[]
  for idx,l,r in reversed(X):
    if idx == -1:
      bit.add(r,1)
    else:
      ans.append((idx,r-l+1-bit.query(l-1,r)))

  # 元の順番にソートし直して出力
  print(*list(zip(*sorted(ans)))[1])
  
if __name__=="__main__":
  main()

### FIXED CODE ###

from time import time
start = time()

# 解説放送の解法

class BIT:
    '''https://tjkendev.github.io/procon-library/python/range_query/bit.html'''
    def __init__(self, n):
        self.n = n
        self.data = [0]*(n+1)
        self.el = [0]*(n+1)
    def sum(self, i):
        s = 0
        while i > 0:
            s += self.data[i]
            i -= i & -i
        return s
    def add(self, i, x):
        self.el[i] += x
        while i <= self.n:
            self.data[i] += x
            i += i & -i
    def query(self, i, j=None):
        if j is None:
            return self.el[i]
        return self.sum(j) - self.sum(i)
      
def main():
  N,Q=map(int,input().split())
  *C,=map(int,input().split())
  q = [tuple(map(int,input().split())) for _ in range(Q)]

  # 重複度を数える。
  res=[]
  tmp_dict={}
  for i in range(N):
    if tmp_dict.get(C[i]) != None:
      #(クエリの種類、l, r）
      res.append((tmp_dict[C[i]]<<40) | (Q<<20) | i)
      del tmp_dict[C[i]]
    tmp_dict[C[i]] = i

  # クエリと合わせてソート。
  X = []
  for i in range(Q):
    l,r = q[i]
    # (元のクエリの順番、l, r)
    X.append(((l-1)<<40) | (i<<20) | r-1)
    
  X.extend(res) 
  X = sorted(X)

  # 平面走査
  bit = BIT(N)
  ans=[0]*Q
  mask = (1<<20) - 1
  for l in reversed(X):
    r = l & mask
    l >>= 20
    idx = l & mask
    l >>= 20
    if idx == Q:
      bit.add(r,1)
    else:
      ans[idx] = r-l+1-bit.query(l-1,r)
      
  print(*ans)
  
if __name__=="__main__":
  main()
n, k = map(int,input().split())
from math import factorial
ans = []
if n == k:
    ans.append(1)
else:
    for i in range(1, k+1):
        c = int(factorial(n-k+1) / (factorial(n-k+1 - i) * factorial(i)))
        if i > k-i:
            c2 = int(factorial(i) / (factorial(i-(k-i)) * factorial(k-i)))
        else:
            c2 = 1
        if c > 0:
            ans.append(c*c2)

mod = 10**9 + 7
for j in ans:
    print(j%mod)

### FIXED CODE ###

import math
def C(n,r):
  if n<0 or r<0 or n-r<0:
    return 0
  else:
    return math.factorial(n)//(math.factorial(r)*math.factorial(n-r))
 
n,k=map(int,input().split())
for i in range(1,k+1):
  print(C(n-k+1,i)*C(k-1,i-1)%(10**9+7))
def search_left(ind):
  doors = []
  for j in range(ind - 1, -1, -1):
    if alst[j] < 0:
     doors.append((j, -alst[j]))
    if alst[j] == 0:
      ret = alst[ind]
      for pos, lim in doors:
        ret = min(ret, lim - (ind - pos))
      ret = max(0, ret)
      return ret
  return 0

def search_right(ind):
  doors = []
  for j in range(ind + 1, w):
    if alst[j] < 0:
      doors.append((j, -alst[j]))
    if alst[j] == 0:
      ret = alst[ind]
      for pos, lim in doors:
        ret = min(ret, lim - (pos - ind))
      ret = max(0, ret)
      return ret
  return 0

def main():
  w = int(input())
  alst = list(map(int, input().split()))
  ans = 0
  for ind, a in enumerate(alst):
    if a > 0:
      ans += max(search_left(ind), search_right(ind))
  print(ans)
main() 


### FIXED CODE ###

w = int(input())
alst = list(map(int, input().split()))
INF = 10 ** 20
acc = -INF
left = []
for i in range(w):
  a = alst[i]
  if a == 0:
    acc = INF
  elif a > 0:
    acc -= 1
  elif a < 0:
    acc = min(acc - 1, -a)
  left.append(acc)

acc = -INF
right = []
for i in range(w):
  a = alst[w - i - 1]
  if a == 0:
    acc = INF
  elif a > 0:
    acc -= 1
  elif a < 0:
    acc = min(acc - 1, -a)
  right.append(acc)
right.reverse()

print(sum([max(0, min(alst[i], max(left[i], right[i]))) for i in range(w)]))
N = int(input())
A = input()
a = A.split()
sum = 1
for i in range(N):
    sum *= int(a[i])
    if sum > 10**18:
        print(-1)
        flag = 1
        break
if flag == 0:
    print(sum)

### FIXED CODE ###

N = int(input())
A = input()
a = A.split()
s = 1
flag = 0
if "0" in a:
    print(0)
else:
    for i in range(N):
        s *= int(a[i])
        if s > 10**18:
            print(-1)
            flag = 1
            break
    if flag == 0:
        print(s)
n, m = map(int, input().split())

h = {}
for k, v in zip(range(1,n+1),[k for k in map(int, input().split())]):
    h[k] = v 

miti = []
for i in range(m):
    temp = [k for k in map(int, input().split())]
    miti.append(temp)

x = np.zeros(n)

for i in range(m):
    if h[miti[i][0]] < h[miti[i][1]]:
        x[miti[i][0]-1] =+1
    elif h[miti[i][0]] > h[miti[i][1]]:
        x[miti[i][1]-1] =+1
    elif h[miti[i][0]] == h[miti[i][1]]:
        x[miti[i][0]-1] =+1
        x[miti[i][1]-1] =+1

print(sum(x == 0))


### FIXED CODE ###

import numpy as np

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

h = {}
for k, v in zip(range(1,n+1),[k for k in map(int, input().split())]):
    h[k] = v 

miti = []
for i in range(m):
    temp = [k for k in map(int, input().split())]
    miti.append(temp)

x = np.zeros(n)

for i in range(m):
    if h[miti[i][0]] < h[miti[i][1]]:
        x[miti[i][0]-1] =+1
    elif h[miti[i][0]] > h[miti[i][1]]:
        x[miti[i][1]-1] =+1
    elif h[miti[i][0]] == h[miti[i][1]]:
        x[miti[i][0]-1] =+1
        x[miti[i][1]-1] =+1

print(sum(x == 0))
n = int(input())
a = [int(input()) for i in range(n)]
mx = max(a)
mxi = a.index(mx)
mx2 = a[:mxi] + a[mxi+1:]

for i in range(n):
    if i == mxi: print(mx2) 
    else: print(mn)


### FIXED CODE ###

n = int(input())
a = [int(input()) for i in range(n)]
mx = max(a)
mxi = a.index(mx)
mx2 = max(a[:mxi] + a[mxi+1:])

for i in range(n):
    if i == mxi: print(mx2) 
    else: print(mx)
s = list(input())
for i in s:
  if i == 9:
    i = 1
  elif i == 1:
    i = 9:
for i in s:
  print(i,end="")

### FIXED CODE ###

s = list(input())
for i in range(len(s)):
    if s[i] == "9":
        s[i] = "1"
    elif s[i] == "1":
        s[i] = "9"
for i in s:
    print(i,end="")
import re

date_s = input()

date_l = re.replace("/", "")

if(date_l <= 20190430):
  print "Heisei"
else:
  print "TBD"
    

### FIXED CODE ###

import re

date_s = input()

date_l = int(date_s.replace("/", ""))

if(date_l <= 20190430):
  print("Heisei")
else:
  print("TBD")
#include <bits/stdc++.h>
using namespace std;
int main(void){
  int n;
  cin>>n;
  int a,b;
  if (n==1) cout<<"Hello World";
  else{
    cin>>a;
    cin>>b;
    cout<<a+b;
  }
}


### FIXED CODE ###

N=int(input())
if N==1:
    print("Hello World")
else:
    a=int(input())
    b=int(input())
    print(a+b)
s=input()
l='abcdefghijklmnopqrstuvwxyz'
s=''.join(list(set(s)))
s=sorted(s)
for i in range(26):
    if(s[i]!=l[i]):
        print(l[i])
        exit()


### FIXED CODE ###

s=input()
l='abcdefghijklmnopqrstuvwxyz'
for i in range(26):
    if(s.count(l[i])==0):
        print(l[i])
        exit()
print('None')
x, y, z = input.split()
a = "No"
if x != y:
	if y = z:
      a = "Yes"
      elif x = z:
        a = "Yes"
      else: a = "No"
if x = y:
  if y = z:
    a = "No"
    elif x = z:
      a = "No"
    else: a = "Yes"
print(a)

### FIXED CODE ###

x, y, z = input().split()
a = "No"
if x != y:
    if x == z:
        a = "Yes"
    elif y == z:
        a = "Yes"
    else:
        a = "No"
if x == y:
    if x == z:
        a = "No"
    elif y == z:
        a = "No"
    else:
        a = "Yes"
print(a)
print(max(0,c-b+a))

### FIXED CODE ###

a,b,c=map(int,input().split())
print(max(0,c+b-a))
n, m = map(int, input().split())
dic = {}
for i in range(m):
  s_tmp, c_tmp = list(map(int, input().split()))
  if s_tmp in dic:
    if dic[s_tmp] != c_tmp:
      print(-1)
      exit()
    else:
      continue
  dic[s_tmp] = c_tmp
  
if dic[1] == 0:
  if n != 1:
    print(-1)
    exit()
  else:
    print(0)

num = 0
for i in range(1,n+1):
  if i in dic:
    num += dic[i] * pow(10, n-i)
print(num)

### FIXED CODE ###

n, m = map(int, input().split())
if m == 0:
  if n == 1:
    print(0)
    exit()
  else:
    print(pow(10,n-1))
    exit()
num = 0
dic = {}
for i in range(m):
  s_tmp, c_tmp = list(map(int, input().split()))
  if s_tmp in dic:
    if dic[s_tmp] != c_tmp:
      print(-1)
      exit()
    else:
      continue
  dic[s_tmp] = c_tmp

if 1 in dic:
  if dic[1] == 0:
    if n != 1:
      print(-1)
      exit()
    else:
      print(0)
      exit()
else:
  num = pow(10,n-1)
for i in range(1,n+1):
  if i in dic:   
    num += dic[i] * pow(10, n-i)

      
print(num)
if __name__ == "__main__":
    while 1:
        x,y,z = list(map(int,input().strip().split()))
        if x ==0 and y ==0 and z ==0:break
        data = []
        for i in range(1,z):
            t1 = i + int(i *  x/100)
            for j in range(1,z):
                t2 = j + int(j * (x/100))
                if t1 + t2 == z:data.append([i,j])
        ans = 0
        for k in data:
            temp = k[0] + int(k[0]* (y/100)) + k[1] + int(k[1]* y/100)
            if  temp > ans: ans = temp
        print(ans)

### FIXED CODE ###

if __name__ == "__main__":
    while 1:
        x,y,z = list(map(int,input().strip().split()))
        if x ==0 and y ==0 and z ==0:break
        data = []
        for i in range(1,z):
            t1 = i + int(i * x/100)
            for j in range(1,z-t1+1):
                t2 = j + int(j * x/100)
                if t1 + t2 == z:data.append([i,j])
        ans = 0
        for k in data:
            temp = k[0] + int(k[0]* y/100) + k[1] + int(k[1]* y/100)
            if temp > ans: ans = temp
        print(ans)
import math

n, m = list(map(int, input().split()))
k = 0
for i in range(1, int(math.sqrt(m) + 1)):
    if m % i == 0 and m/k >= n:
        k = i
print(k)

### FIXED CODE ###

import math

n, m = list(map(int, input().split()))
reg = (m / n)
k = 1
for i in range(1, int(math.sqrt(m) + 1)):
    if m % i == 0:
        a = m/i
        b = i
        if reg >= b and k < b:
            k = b
        if reg >= a and k < a:
            k = a
print(int(k))
a,b = input().split()
x,y = int(input().split())
k = input()

if a == k :
  print(x-1,y)
else
  print(x,y-1)


### FIXED CODE ###

S,T = input().split()
A,B = map(int, input().split())
U = input()

if S==U:
    A -= 1
else:
    B -= 1
print(A,B)
a,b,c,z = map(int,input().split())

aa = list(map(int,input().split()))
aa.sort(reverse = True)
bb = list(map(int,input().split()))
bb.sort(reverse = True)
cc = list(map(int,input().split()))
cc.sort(reverse = True)
al = []
aal = []
for i in aa:
    for j in bb:
        al.append(i+j)
al.sort()
if len(al) > k:
    al = al[len(al)-k:]

for i in al:
    for j in cc:
        aal.appned(i+j)
aal.sort()

if len(aal) > k:
    aal = aal[len(aal)-k:]
aal.reverse()
for i in aal:
    print(i)

### FIXED CODE ###

a,b,c,k = map(int,input().split())

aa = list(map(int,input().split()))
aa.sort(reverse = True)
bb = list(map(int,input().split()))
bb.sort(reverse = True)
cc = list(map(int,input().split()))
cc.sort(reverse = True)
al = []
aal = []
for i in aa:
    for j in bb:
        al.append(i+j)
al.sort()
if len(al) > k:
    al = al[len(al)-k:]

for i in al:
    for j in cc:
        aal.append(i+j)
aal.sort()

if len(aal) > k:
    aal = aal[len(aal)-k:]
aal.reverse()
for i in aal:
    print(i)
n = int(input())
dlist = []
for i in range(n):
    code = input().split()
    if code[0] == "insert":
        dlist.insert(0,code[1])
    if code[0] == "delete":
        dlist.remove(code[1])
    if code[0] == "deleteFirst":
        dlist.pop(0)
    if code[0] == "deleteLast":
        dlist.pop()
print(*dlist,sep=" ")

### FIXED CODE ###

from collections import deque
n = int(input())
dlist = deque()
for i in range(n):
    code = input().split()
    if code[0] == "insert":
        dlist.insert(0,code[1])
    if code[0] == "delete":
        try:
            dlist.remove(code[1])
        except:
            continue
    if code[0] == "deleteFirst":
        dlist.popleft()
    if code[0] == "deleteLast":
        dlist.pop()
print(*dlist,sep=" ")
N = int(input())
if N < 1000:
  print('ABC{:03}'.format(N))
else:
  print('ABD{:03}'.format(str(N)[1:]))


### FIXED CODE ###

N = int(input())
print('ABC' if N < 1000 else 'ABD')
import sys
input = sys.stdin.readline

n,m = map(int,input().split())
a = list(map(int,input().split()))
a.sort(reverse=True)
j = 0
for i in range(m):
  a[j] //= 2
  if a[0] > a[j]:
    j = 0
    a.sort(reverse=True)
  elif a[j] < a[j+1]:
    j += 1
print(sum(a))

### FIXED CODE ###

import sys
input = sys.stdin.readline
import heapq as hp

n,m = map(int,input().split())
a = list(map(lambda x: int(x)*(-1),input().split()))
hp.heapify(a)
tmp = 0

for i in range(m):
  tmp = hp.heappop(a)
  hp.heappush(a,(-tmp//2)*(-1))
#
print(-sum(a))
n, x = map(int, input().split())

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

tmp = 0
for i in range(100000):
    tmp += l_list[i]
    if tmp > x:
        break

print(i+1)


### FIXED CODE ###

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

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

tmp = 0
for i in range(n):
    tmp += l_list[i]
    if tmp > x:
        break

if tmp <= x:
    print(101)
else:
    print(i+1)
n,i = map(int,input().spllit())
print(n-i+1)

### FIXED CODE ###

n,i = map(int,input().split())
print(n-i+1)
N,A,B = map(int,input().split())

Line1 = ("b"*A+"r"*B)
Line2 = ("b"*A+"r"*B)
Cnt = 0
while Cnt < N/(A+B):
	Line2 += Line1
	Cnt += 1

print(Line2[:N].count("b"))


### FIXED CODE ###

S = input()
if S == "AAA" or S == "BBB":
	print("No")
else:
	print("Yes")
n = input()
a = map(int, raw_input().split())
for i in range(len(a)-1,-1,-1):
    print a[i],
print ""

    

### FIXED CODE ###

input()
xs=reversed(input().split())
print(" ".join(xs))
from math import sqrt
x1, y1, x2, y2 = [float(iv) for iv in input().split()]
print sqrt(abs(x2-x1)**2 + abs(y2-y1)**2)

### FIXED CODE ###

from math import sqrt
x1, y1, x2, y2 = [float(iv) for iv in raw_input().split()]
print sqrt(abs(x2-x1)**2 + abs(y2-y1)**2)
pres_rate = input()
goal_rate = input()
next_rate = goal_rate * 2 - pres_rate
print(next_rate)


### FIXED CODE ###

pres_rate = int(input())
goal_rate = int(input())
next_rate = goal_rate * 2 - pres_rate
print(next_rate)
:!cat tes.py
array = []
for i in range(3,int(input()) + 1):
  if i % 3 == 0 or i % 10 == 3:
    array.append(i)
for i in array:
  print('',"{0}".format(i),end='')

### FIXED CODE ###

n = int(input())
nums = []
for i in range(3, n + 1):
  if i % 3 == 0 or i % 10 == 3 or '3' in str(i):
      #print('',i,end='')
      nums.append(i)
for i in nums:
    print('',i,end='')
print()
n = int(input())
as = list(map(int,input().split()))

ans = 1

for i in as:
    ans *= i
    ans = min(i, 10*18+1)
    if ans == 10**18+1:
        print('-1')

else:
    print(ans)


### FIXED CODE ###

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

ans = 1

for i in As:
    ans *= i
    ans = min(ans, 10**18 + 1)

if ans == 10**18 + 1:
    print(-1)

else:
    print(ans)
def main(a, b):
    add = a + b
    sub = a - b
    mul = a * b

    return max(add, sub, mul)


if __name__ == "__main__":
    a, b = input().split(' ')
    print(main(a, b))


### FIXED CODE ###

def main(a, b):
    add = a + b
    sub = a - b
    mul = a * b

    return max(add, sub, mul)


if __name__ == "__main__":
    a, b = map(int, input().split(' '))
    print(main(a, b))
import numpy as np

N, M, X = list(map(int, input().split()))
a = np.zeros((N, M))
C = np.zeros(N)
for i in range(N):
    tmp = list(map(int, input().split()))
    C[i] += tmp[0]
    a[i] += tmp[1:]

a = a.reshape(M, N)

answer_price = 2**10

for i in range(1 << N):
    tmp = np.zeros(M)
    cost = 0
    for j in range(N):
        if i % 2 == 1:
            tmp += a[j]
            cost += C[j]
        i = i >> 1
    if all(tmp >= X) and cost < answer_price:
        answer_price = cost
        
if answer_price == 2**10:
    print("-1")
else:
    print(int(answer_price))

### FIXED CODE ###

import numpy as np

N, M, X = list(map(int, input().split()))
a = np.zeros((N, M))
C = np.zeros(N)
for i in range(N):
    tmp = list(map(int, input().split()))
    C[i] += tmp[0]
    a[i] += tmp[1:]
    
answer_price = 10**10

for i in range(1 << N):
    tmp = np.zeros(M)
    cost = 0
    for j in range(N):
        if i % 2 == 1:
            tmp += a[j]
            cost += C[j]
        i = i >> 1

    if all(tmp >= X) and (cost < answer_price):
        answer_price = cost
        
if answer_price == 10**10:
    print("-1")
else:
    print(int(answer_price))
a,b = map(int, input().split(' '))

posts = input().split('-')
if len(s) == 2 and a == len(post[0]) and b == len(post[1]) and s[0].isnumeric() and s[1].isnumeric():
    print("Yes")
else:
    print("No")

### FIXED CODE ###

print(48 - int(input()))
date = input()
print("2018"  + data[4:])

### FIXED CODE ###

date = input()
print("2018"  + date[4:])
N = int(input())
S = [input() for i in range(N)]

ac = S.count('AC')
wa = S.count('WA')
tle = S.count('TLE')
re = S.count('RE')

print('AC', x, ac)
print('WA', x, wa)
print('TLE', x, tle)
print('RE', x, re)

### FIXED CODE ###

N = int(input())
S = [input() for i in range(N)]

ac = S.count('AC')
wa = S.count('WA')
tle = S.count('TLE')
re = S.count('RE')

print('AC x',ac)
print('WA x',wa)
print('TLE x',tle)
print('RE x',re)
import sys
from math import factorial

def comb(n, k):
    return int(factorial(n)) / int(factorial(k)) / int(factorial(n-k))

def h_comb(n, k):
    return int(factorial(n+k-1)) / int(factorial(k)) / int(factorial(n - 1))

n, k =[int(i) for i in sys.stdin.readline().split()]
bl_ls = []
red_ls = []
for i in range(1,k+1):
    print(int(comb(k-1, i-1) * h_comb(i+1, n-k-i+1) % (10**9+7)))

### FIXED CODE ###

import sys
from math import factorial

def comb(n, k):
    return int(factorial(n)) // int(factorial(k)) // int(factorial(n-k))

def h_comb(n, k):
    return int(factorial(n+k-1)) // int(factorial(k)) // int(factorial(n - 1))

n, k =[int(i) for i in sys.stdin.readline().split()]
for i in range(1,k+1):
    if n-k-i+1 < 0:
        print(0)
    else:
        x = comb(k-1, i-1)
        y = h_comb(i+1, n-k-i+1)
        print(int( x * y )% (10**9+7))
S = [int(x) for x in input().split()]
for i in range(5)
	if S[i]==0
  		print(i+1)
        exit()

### FIXED CODE ###

S = [int(x) for x in input().split()]
for i in range(5):
	if S[i]==0:
		print(i+1)
		exit()