Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

import itertools

N = int(input())

L = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
A = list(itertools.product(L, repeat=N))

count = 0

for a in A:
    if (0 in a) and (9 in a):
        count += 1

print(count % (1000000007))


### FIXED CODE ###

NUM = 1000000007

N = int(input())

all_colab = pow(10, N)
except_0or9_colab = pow(9, N)
except_0and9_colab = pow(8, N)

include_0and9_colab = all_colab - (2*except_0or9_colab - except_0and9_colab)

print(include_0and9_colab % NUM)
### BUGGY CODE ###

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

C=[1]
for i in range(2,min(A,B)+1):
    if A % i == 0 and B % i == 0:
        C.append(i)
gcd=max(C)

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
  
z=prime_factorize(gcd)
print(len(set(z))+1)

### FIXED CODE ###

import fractions
import collections
   
A,B = map(int,input().split())
gcd = fractions.gcd(A,B)

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

c = collections.Counter(prime_factorize(gcd))
print(len(list(c.keys()))+1)
### BUGGY CODE ###

import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

A, B = MAP()

def cf(x1,x2):
    cf=[]
    for i in range(1, min(x1,x2) + 1):
        if x1 % i == 0 and x2 % i == 0:
            cf.append(i)
    return cf

def primes_for(n):
   is_prime = [True] * (n + 1)
   is_prime[0] = False
   is_prime[1] = False
   for i in range(2, n + 1):
       for j in range(i * 2, n + 1, i):
           is_prime[j] = False
   return [i for i in range(n + 1) if is_prime[i]]

a = cf(A, B)
b = primes_for(a[len(a) - 1])
b.append(1)

print(len(set(a) & set(b)))

### FIXED CODE ###

import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

A, B = MAP()

def cf(x1,x2):
    cf=[]
    for i in range(1, min(x1,x2) + 1):
        if x1 % i == 0 and x2 % i == 0:
            cf.append(i)
    return cf

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    return divisors

def primes_for(n):
   is_prime = [True] * (n + 1)
   is_prime[0] = False
   is_prime[1] = False
   for i in range(2, n + 1):
       for j in range(i * 2, n + 1, i):
           is_prime[j] = False
   return [i for i in range(n + 1) if is_prime[i]]

a = make_divisors(A)
b = make_divisors(B)

kouyaku = (set(a) & set(b))

# p = primes_for(10**6)
# p.append(1)

# print(len((set(kouyaku) & set(p))))

def is_prime(n):
    if n == 1:
        return True
    for i in range(2,int(n**0.5)+1):
        if n % i == 0:
            return False
    return True

wa = 0
for i in kouyaku:
	if is_prime(i):
		wa += 1
print(wa)
### BUGGY CODE ###

n=int(input())
mas=list(map(int,input().split()))
out=[]

for i in range(n):
  j=i
  ans=0
  while j<n-1:
    if mas[j]>=mas[j+1]:
      ans+=1
    else:
      break
    j+=1

  out.append(ans)
  
print(max(out))


### FIXED CODE ###

n=int(input())
mas=list(map(int,input().split()))
out=[]
mx=0
i=0
while i<n:
  if mx>n-i:
    break
  j=i
  ans=0
  while j<n-1:
    if mas[j]>=mas[j+1]:
      ans+=1
    else:
      break
    j+=1
  
  if ans>mx:
    mx=ans
  i+=ans+1
  
print(mx)
### BUGGY CODE ###

import math
n=int(input())
z=0
ans=0
for N in range(1,n+1):
    ans=0
    z=0
    for x in range(1,100):
        if x**2+x+x>=N:
            break
        for y in range(1,100):
            if x**2+y**2+x*y+x+y>=N:
                break
            if (x+y)**2+4*N-4*(x**2+y**2)-4*x*y>=0:
                z=((-x-y)+math.sqrt((x+y)**2+4*N-4*(x**2+y**2)-4*x*y))/2
                #print(x,y,z)
                if z>=1 and z%1==0:
                    ans+=1
                    #print(x,y,z)
    print(ans)

### FIXED CODE ###

n=int(input())
z=0
N=[0]*10000
ans=0
ko=0
for x in range(1,101):
    for y in range(1,101):
        for z in range(1,101):
            ko=x**2+y**2+z**2+x*y+y*z+z*x
            if ko<=n:
                N[ko-1]+=1
            else:
                break
for i in range(n):
    print(N[i])
### BUGGY CODE ###

#!/usr/bin/python3
# -*- coding: utf-8 -*-
from bisect import bisect_left
from sys import stdin
from heapq import heappush, heappop


def main():
  ## input
  N,Q = map(int, stdin.readline().rstrip().split())
  STX = [[0,0,0] for _ in range(N)]
  for i in range(N):
    s,t,x = map(int, stdin.readline().rstrip().split())
    STX[i] = [x,s-x,t-x]
  Dn = [int(stdin.readline().rstrip()) for _ in range(Q)] + [10**10]
  ans = []

  for x,s,t in sorted(STX):
    l = bisect_left(Dn,s)
    r = l
    while Dn[r] < t:
      heappush(ans, (Dn[r],x))
      r += 1
    Dn = Dn[:l]+Dn[r:]

  for d in Dn[:-1]:
    heappush(ans, (d,-1))

  return ans


if __name__ == "__main__":
  ans = main()
  while len(ans) > 0:
    print(heappop(ans)[1])    


### FIXED CODE ###

import sys
from bisect import bisect_left



N,Q = map(int, input().split())
lines = sys.stdin.readlines()
kkk = []
for line in lines[:N]:
  s, t, x = map(int, line.split())
  kkk.append((x, s, t))
kkk.sort()
ddd = list(map(int, lines[N:]))

ans = [-1] * Q
skip = [-1] * Q
for x, s, t in kkk:
  ss = bisect_left(ddd, s - x)
  tt = bisect_left(ddd, t - x)
  while ss < tt:
    sk = skip[ss]
    if sk == -1:
      ans[ss] = x
      skip[ss] = tt
      ss += 1
    else:
      ss = sk

print('\n'.join(map(str, ans)))
### BUGGY CODE ###

import sys

N = int(sys.stdin.readline())
P = list(map(int, sys.stdin.readline().split()))

count = 0
max = P[0]
for i in range(N):
    if P[i] > max:
        max = P[i]
    else:
        for j in range(i+1):
            if P[i] > P[j]:
                break
        else:
            count += 1
            
print(count)

### FIXED CODE ###

import sys

N = int(sys.stdin.readline())
P = list(map(int, sys.stdin.readline().split()))

count = 0
min = P[0]
for i in range(N):
    if P[i] <= min:
        min = P[i]
        count += 1
    """
    else:
        for j in range(i+1):
            if P[i] > P[j]:
                break
        else:
            count += 1
    """
print(count)
### BUGGY CODE ###

from operator import itemgetter


def main():
    n, q = list(map(int, input().split()))
    stops = []
    for _ in range(n):
        s, t, x = list(map(int, input().split()))
        stops.append((s, t, x))
    delay = []
    for i in range(q):
        delay.append([int(input()), False, -1])

    stops = sorted(stops, key=itemgetter(2))

    for s, t, x in stops:
        for idx, item in enumerate(delay):
            d, stopped, score = item
            if not stopped:
                time_at_x = x + d
                if s - 0.5 < time_at_x < t - 0.5:
                    delay[idx][2] = x
                    delay[idx][1] = True

    for item in delay:
        print(item[2])


main()

### FIXED CODE ###

from operator import itemgetter
from bisect import bisect_left


def main():
    n, q = list(map(int, input().split()))
    stops = []
    for _ in range(n):
        s, t, x = list(map(int, input().split()))
        stops.append((s, t, x))
    delay = []
    for i in range(q):
        delay.append(int(input()))

    stops = sorted(stops, key=itemgetter(2))
    delay = sorted(delay)

    result = [-1] * q
    skips = [-1] * q

    for s, t, x in stops:
        sx = bisect_left(delay, s - x)
        tx = bisect_left(delay, t - x)
        while sx < tx:
            if skips[sx] == -1:
                result[sx] = x
                skips[sx] = tx
                sx += 1
            else:
                sx = skips[sx]

    for r in result:
        print(r)


main()
### BUGGY CODE ###

#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,ceil,sqrt,factorial,hypot,log #log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from fractions import gcd
from random import randint
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    H, N = MI()
    AB = LLIN(N)

    dp = [inf]*(H+1)
    dp[0] = 0
    for a,b in AB:
        for h in range(H+1):
            if h>=a:
                dp[h] = min(dp[h], dp[h-a] + b)
            else:
                dp[h] = min(dp[h], b)

    print(dp[H])
if __name__ == '__main__':
    main()

### FIXED CODE ###

#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,ceil,sqrt,factorial,hypot,log #log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from fractions import gcd
from random import randint
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    H, N = MI()
    AB = LLIN(N)

    dp = [inf]*(H+1)
    dp[0] = 0
    for a,b in AB:
        for h in range(H+1):
            if h>=a:
                dp[h] = min(dp[h], dp[h-a] + b)
            else:
                dp[h] = min(dp[h], b)

    print(dp[H])
if __name__ == '__main__':
    main()
### BUGGY CODE ###

s=input()
r=set()
last=0
power=0
d={}
total=0
for i in range(len(s)-1,-1,-1):
    n=int(s[i])*(10**(power))+last
    power+=1
    last=n%2019
    rem=n%2019
    if rem==0:
        total+=1
    if rem in r:
        d[rem]+=1
        total+=d[rem]-1
    else:
        r.add(rem)
        d[rem]=1

print(total)


### FIXED CODE ###

s=input()
r=set()
last=0
power=1
d={0:0}
total=0
rem=0
for i in range(len(s)-1,-1,-1):#handling of 0's as n and rem
    n=int(s[i])*power+rem
    power*=10
    power=power%2019
    rem=n%2019
    if rem in d.keys():
        d[rem]+=1
    else:
        d[rem]=1
    total+=d[rem]-1
print(total+d[0])
### BUGGY CODE ###

N, M = map(int, input().split())
m = set(range(N))
for i in range(M):
	L, R = map(int, input().split())
	_m = set(range(L-1, R))
	m = m & _m
	if m == set() : break
print(len(m))

### FIXED CODE ###

N, M = map(int, input().split())
L, R = 0, N
for i in range(M):
	_L, _R = map(int, input().split())
	L = max(_L, L)
	R = min(_R, R)

print(max(R - L + 1, 0))
### BUGGY CODE ###

from operator import mul
from functools import reduce


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


def main():
    n, m = map(int, input().split())
    MOD = 10 ** 9 + 7

    m0 = m
    primes = {}
    p = 2
    # prime factorization
    while m0 > 1:
        if m0 % p == 0:
            m0 /= p
            if p in primes:
                primes[p] += 1
            else:
                primes[p] = 1
        else:
            p += 1

    ans = 1
    for _, v in primes.items():
        ans *= cmb(n - 1 + v, v)
        ans %= MOD
    print(ans)


main()


### FIXED CODE ###

from operator import mul
from functools import reduce


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


def main():
    n, m = map(int, input().split())
    MOD = 10 ** 9 + 7

    m0 = m
    primes = {}
    p = 2
    rtm = int(m ** 0.5 + 1)
    # prime factorization
    while m0 > 1:
        if m0 % p == 0:
            m0 /= p
            if p in primes:
                primes[p] += 1
            else:
                primes[p] = 1
        else:
            p += 1
        # m is prime
        if rtm <= p:
            primes[1] = 1
            break

    ans = 1
    for _, v in primes.items():
        ans *= cmb(n - 1 + v, v)
        ans %= MOD
    print(ans)


main()
### BUGGY CODE ###

S = list(input())
S = S[::-1]

ans = 0
bc_score = 0
flag = 1

if len(S) <= 1:
    print(0)
    exit()

while len(S) != 0:
    if S[0]=="C" and S[1] == "B":
        bc_score = 0
        bc_score += 1
        S.pop(0)
        S.pop(0)
        flag = 1
        if len(S) <= 1:
            if S[0] == "A":
                ans += 1
            S.pop(0)
        while flag == 1 and len(S) != 0:
            flag = 0
            if S[0]=="C" and S[1] == "B":
                bc_score += 1
                S.pop(0)
                S.pop(0)
                flag = 1
            if S[0] == "A":
                ans += bc_score
                S.pop(0)
                flag = 1
    else:
        S.pop(0)

print(ans)

### FIXED CODE ###

S = list(input())
S = S[::-1]

t = 0
ans = 0
bc_score = 0
flag = 1

if len(S) <= 2:
    print(0)
    exit()

while t <= len(S)-2:
    if S[t]=="C" and S[t+1] == "B":
        bc_score = 0
        bc_score += 1
        t += 2
        flag = 1
        if t == len(S)-1:
            if S[t] == "A":
                ans += 1
            t += 1
        while flag == 1 and t <= len(S) - 1:
            flag = 0
            if S[t]=="C" and S[t+1] == "B":
                bc_score += 1
                t += 2
                flag = 1
            if t <= len(S) - 1:
                if S[t] == "A":
                    ans += bc_score
                    t += 1
                    flag = 1
    else:
        t += 1

print(ans)
### BUGGY CODE ###

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

def myinput():
    return map(int,readline().split())

n = int(readline())
a = list(myinput())
mod = 10**9 + 7
ans = 0

if max(a)==0:
  print(0)
  exit()

for j in reversed(range(60)):
    one = 0
    zero = 0
    for i in range(n):
        b = str(bin(a[i]))[2:]
        c = b.zfill(60)
        s = int(c[j])
        if s==0:
            zero += 1
        else:
            one += 1
    ans_bit = zero * one
    ans += (ans_bit)*(2**(59-j)) 
    ans %= mod
print(ans%mod)

### FIXED CODE ###

import math
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

def myinput():
    return map(int,readline().split())

n = int(readline())
a = list(myinput())
mod = 10**9 + 7
ans = 0

for j in range(60):
    k = 2**j
    one = 0
    zero = 0
    for i in range(n):
        if (a[i]&k):
            one += 1
        else:
            zero += 1
    ans_bit = zero * one
    ans += (ans_bit)*(2**j) 
    ans %= mod   

print(ans%mod)
### BUGGY CODE ###

L, R = map(int, input().split())
res = 2*10**9
for i in range(L, R + 1):
  for j in range(i + 1, R + 1):
    res = min(res, (i*j) % 2019)
print(res)

### FIXED CODE ###

L, R = map(int, input().split())

if (R - L) >= 2019:
  print(0)
  
else:
  res = 2*10**9
  for i in range(L, R):
    for j in range(i + 1, R + 1):
      res = min(res, (i*j) % 2019)
  print(res)
### BUGGY CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
N, M, L = map(int, input().split())
ABC = [list(map(int, input().split())) for _ in range(M)]
Q = int(input())
st = [list(map(int, input().split())) for _ in range(Q)]


def wf(d):
    for k in range(N):
        for i in range(N):
            for j in range(N):
                d[i][j] = min(d[i][j], d[i][k]+d[k][j])

d = [[float('inf') for _ in range(N)] for _ in range(N)]

for abc in ABC:
    d[abc[0]-1][abc[1]-1] = abc[2]
    d[abc[1]-1][abc[0]-1] = abc[2]
for i in range(N):
    d[i][i] = 0
wf(d)

for i in range(N):
    for j in range(N):
        if d[i][j] <= L:
            d[i][j] = 1
        else:
            d[i][j] = float('inf')

wf(d)

for sti in st:
    res = d[sti[0]-1][sti[1]-1]
    if res == float('inf'):
        print(-1)
    else:
        print(res-1)

### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
N, M, L = map(int, input().split())
ABC = [list(map(int, input().split())) for _ in range(M)]
Q = int(input())
st = [list(map(int, input().split())) for _ in range(Q)]


def wf(d):
    for k in range(N):
        for i in range(N):
            for j in range(N):
                d[i][j] = min(d[i][j], d[i][k]+d[k][j])

d = [[float('inf') for _ in range(N)] for _ in range(N)]

for abc in ABC:
    d[abc[0]-1][abc[1]-1] = abc[2]
    d[abc[1]-1][abc[0]-1] = abc[2]
for i in range(N):
    d[i][i] = 0
wf(d)

for i in range(N):
    for j in range(N):
        if d[i][j] <= L:
            d[i][j] = 1
        else:
            d[i][j] = float('inf')

wf(d)

for sti in st:
    res = d[sti[0]-1][sti[1]-1]
    if res == float('inf'):
        print(-1)
    else:
        print(res-1)
### BUGGY CODE ###

X,Y,Z,K= map(int,input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))


A.sort()
A.reverse()
B.sort()
B.reverse()
C.sort()
C.reverse()

ab_list = []

for i in range(X):
    for j in range(Y):
        ab_list.append(A[i]+B[j])

ab_list.sort()
ab_list.reverse()
ab_list2 = ab_list[:K]
abc_list = []

count = 0
count2 = 0

for i in range(min(X*Y,K)):
    for j in range(Z):
        abc_list.append(ab_list2[i]+C[j])

abc_list.sort()
abc_list.reverse()

for i in range(K):
    print(abc_list[i])


    
    


    




    

### FIXED CODE ###

X,Y,Z,K= map(int,input().split())
A = sorted(list(map(int,input().split())), reverse=True)
B = sorted(list(map(int,input().split())), reverse=True)
C = sorted(list(map(int,input().split())), reverse=True)



ab_list = []

for i in range(X):
    for j in range(Y):
        ab_list.append(A[i]+B[j])

ab_list2 = sorted(ab_list,reverse = True)[:min(X*Y,K)]
abc_list = []

count = 0
count2 = 0

for i in range(min(X*Y,K)):
    for j in range(Z):
        abc_list.append(ab_list2[i]+C[j])


abc_list2 = sorted(abc_list,reverse = True)[:K]

for i in range(K):
    print(abc_list2[i])
### BUGGY CODE ###

import numpy as np

n, k = map(int, input().split())
h = np.array([0] + list(map(int, input().split()))) # index調整

dp = np.array([1<<64] * (n+1))
dp[1] = 0

for i in range(2,n+1):
    for j in range(1,k+1):
        if i - j >= 1:
            dp[i] = min(dp[i-j]+abs(h[i]-h[i-j]), dp[i])
        else:
            break
            
print(dp[n])

### FIXED CODE ###

import numpy as np

n, k = map(int, input().split())
h = np.array([0] + list(map(int, input().split()))) # index調整
dp = np.zeros(n+1,dtype=np.int)

for i in range(2,n+1):
    start = 1 if i - k < 1 else i - k
    dp[i] = min((dp[start:i]+np.abs(h[i]-h[start:i])))            
print(dp[n])
### BUGGY CODE ###

N,Q = map(int,input().split())
S = input()
LR = [list(map(int,input().split())) for i in range(Q)]
for l,r in LR:
    print(S[l-1:r].count('AC'))

### FIXED CODE ###

import bisect

N,Q = map(int,input().split())
S = input()
L = []
for i in range(N):
    if S[i:i+2] == 'AC':
        L.append(i)
for i in range(Q):
    l,r = map(int,input().split())
    a = bisect.bisect_left(L,l-1)
    b = bisect.bisect_right(L,r-2)
    print(b-a)
### BUGGY CODE ###

n = int(input())

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

ans = 1
a_in = [s for s in a if 0 in a]
if a_in:
    print('0')
    exit()
else:
    for i in a:
        ans = ans * i

        if ans > 10 ** 18:
            print('-1')
            exit()

print(ans)


### FIXED CODE ###

n = int(input())

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

ans = 1
if min(a) == 0:
    print('0')
    exit()
else:
    for i in a:
        ans = ans * i

        if ans > 10 ** 18:
            print('-1')
            exit()

print(ans)
### BUGGY CODE ###

S = input()
S = S[::-1]
L = [0]
i = 0
for x in S:
    tmp = L[-1] + 10 ** i * int(x) % 2019
 #   print(tmp % 2019)
    L.append(tmp % 2019)
    i += 1
L = sorted(L[1::])
def counter(array):
    from collections import Counter
    return list(Counter(array).most_common())
c = counter(L)
from math import factorial
def comb(n,r):
    if n == 1: return 0
    return  n * (n - 1) // 2
ans = 0
for x in c:
    if x[0] == 0: ans += x[1]
    ans += comb(x[1],2)
print(int(ans))

### FIXED CODE ###

S = input()
S = S[::-1]
L = [0]
i = 0
for x in S:
    tmp = L[-1] + pow(10, i , 2019) * int(x) 
    L.append(tmp % 2019)
    i += 1
L = sorted(L[1::])
def counter(array):
    from collections import Counter
    return list(Counter(array).most_common())
c = counter(L)
from math import factorial
def comb(n,r):
    if n == 1: return 0
    return  n * (n - 1) // 2
ans = 0
for x in c:
    if x[0] == 0: ans += x[1]
    ans += comb(x[1],2)
print(int(ans))
### BUGGY CODE ###

import itertools

N = int(input())
a = list(int(i) for i in input().split())

for p in itertools.permutations(a, N):
    for i in range(N):
        if i ==0:
            if p[N-1]^p[i+1] != p[i]:
                break
        elif i == N-1:
            if p[i-1]^p[0] != p[i]:
                break
            else:
                print("Yes")
                exit()
        else:
            if p[i-1]^p[i+1] != p[i]:
                break
print("No")

### FIXED CODE ###

a = [input() for i in range(2)]
 
N = int(a[0])
data = a[1].split(' ')
 
data = [int(i) for i in data]
 
result = []
a = 0
for i in range(N):
    a = a ^ data[i]
    
if a == 0:
    print('Yes')
    exit()
    
print('No')