Harryxun/stf_run huggingface dataset:
n = int(input())
A = list(map(int,input().split()))
ans = 1
 
for i in range(n):
    ans = ans*A[i]
    if 0 in A:
        print(0)
        return
    elif ans > 10**18:
      print(-1)
      return
 
print(ans)

### FIXED CODE ###

n = int(input())
A = list(map(int,input().split()))
ans = 1

if 0 in A:
  ans = 0
else:
  for i in range(n):
    ans = ans*A[i]
    if ans > 10**18:
        ans = -1
        break
 
print(ans)
A, B, C, D, E, F = map(int, input().split())

d = 0
for i in range(31):
    if i * 100 * A > F:
        break
    for j in range(31):
        if i * 100 * A + j * 100 * B > F:
            break
        if i == 0 and j == 0:
            break
        for k in range(0, 1501, C):
            if k > i * A * E + j * B * E:
                break
            m = i * 100 * A + j * 100 * B + k
            if m > F:
                break
            l1 = F - m
            l2 = i * A * E + j * B * E - k
            l = min(l1, l2)
            l = int(l / D) * D
            d1 = 100 * (k + l) / (m + l)
            if d < d1:
                w = m + l
                s = k + l
                d = d1
print('{0} {1}'.format(w, s))

### FIXED CODE ###

A, B, C, D, E, F = map(int, input().split())

d = 0
for i in range(31):
    if i * 100 * A > F:
        break
    for j in range(31):
        if i * 100 * A + j * 100 * B > F:
            break
        if i == 0 and j == 0:
            break
        for k in range(0, 1501, C):
            if k > i * A * E + j * B * E:
                break
            m = i * 100 * A + j * 100 * B + k
            if m > F:
                break
            l1 = F - m
            l2 = i * A * E + j * B * E - k
            l = min(l1, l2)
            l = int(l / D) * D
            d1 = 100 * (k + l) / (m + l)
            if d < d1:
                w = m + l
                s = k + l
                d = d1
if d == 0:
    if 100 * A <= F:
        print('{0} {1}'.format(100 * A, 0))
    else:
        print('{0} {1}'.format(100 * B, 0))
else:
    print('{0} {1}'.format(w, s))
a,b = map(int,input().split())
c = 2*b
d = a-c
if a > c:
print(d)
else:
print(int(0))

### FIXED CODE ###

a,b = map(int,input().split())
c = 2*b
d = a-c
if d > 0:
 print(d)
elif d <= 0:
 print(0)
n = int(input())
red = []
red_x = []
blue = []
blue_y = []
for i in range(n):
    a, b = map(int,input().split())
    red.append([a,b])
    red_x.append(a)
    
for i in range(n):
    c, d = map(int,input().split())
    blue.append([c,d])
    blue_y.append(d)

count = 0    
for i in range(n):
    p = max(red_x)
    s = min(blue_y)
    q = 0
    r = 0
    jjj = 0
    kkk = 0
    for j in range(len(red)):
        if red[j][0] == p:
            q = red[j][1]
            jjj = j
    for k in range(len(blue)):
        if blue[k][1] == s:
            r = blue[k][0]
            kkk = k
            
    if p < r and q < s:
        count = count + 1 
        red_x.remove(p)
        blue_y.remove(s)
        red.remove(red[jjj][0])
        blue.remove(blue[kkk][1])


    else:
        None
        
print(count)

### FIXED CODE ###

n = int(input())
red = []
blue = []

for i in range(n):
    a, b = map(int,input().split())
    red.append([a,b])
    

for i in range(n):
    c, d = map(int,input().split())
    blue.append([c,d])
    
red_sort = list(reversed(sorted(red, key=lambda y: y[1])))
blue_sort = sorted(blue, key=lambda x: x[0])

# print(red_sort)
# [[1, 3], [2, 0], [3, 1]]
# print(blue_sort)
# [[4, 2], [0, 4], [5, 5]]

pair = []
for blue_point in blue_sort:
    x_blue = blue_point[0]
    y_blue = blue_point[1]
    
    for red_point in red_sort:
        x_red = red_point[0]
        y_red = red_point[1]
        
        if x_red<x_blue and y_red<y_blue:
            if not (red_point in pair) and not (blue_point in pair):
                pair.append(red_point)
                pair.append(blue_point)
    
print(len(pair) // 2)
a, b = [int(i) for i in input(),split()]
print(a * b, (a + b) * 2)

### FIXED CODE ###

a, b = [int(i) for i in input().split()]
print(a * b, (a + b) * 2)
n = int(input())
if 1 <= n <= 999:
  print(ABC)
else:
  print(ABD)

### FIXED CODE ###

n = int(input())
if 1 <= n <= 999:
  print("ABC")
else:
  print("ABD")
N = int(input())
S = input()
count = 0

for i in range(N-1):
    if S[i:i+2] = '#.':
        count += 1

print(count)

### FIXED CODE ###

N = int(input())
S = input()
a = [0] * N
b = [0] * N
counter = []

if S[0] == '#':
    a[0] = 1
if S[N-1] == '.':
    b[N-1] = 1

for i in range(N-1):
    if S[i+1] == '#':
        a[i+1] = a[i] + 1
    else:
        a[i+1] = a[i]
    if S[N-i-2] =='.':
        b[N-i-2] = b[N-i-1] + 1
    else:
        b[N-i-2] = b[N-i-1]
counter.append(a[N-1])
counter.append(b[0])
for i in range(N-1):
    counter.append(a[i] + b[i+1])

print(min(counter))
N,M = map(int,input().split())
s = {}
ans = 0

for i in range(N):
	a,b = map(int,input().split())
	if a in s.keys():
		s[a] += b
	else:
		s[a] = b

s = sorted(s.items(), key=lambda x:x[0])
for store in s:
	price = store[0]
	stock = store[1]
	if M == 0: break

	if M - stock >= 0:
		M -= stock
		ans += (stock * price)
	else:
		for i in range(stock):
			M -= 1
			ans += price
			if M == 0:
				print(ans)
				exit(1)
print(ans)


### FIXED CODE ###

import sys

N,M = map(int,input().split())
s = {}
ans = 0

for i in range(N):
	a,b = map(int,input().split())
	if a in s.keys():
		s[a] += b
	else:
		s[a] = b

s = sorted(s.items(), key=lambda x:x[0])
for store in s:
	price = store[0]
	stock = store[1]
	if M == 0: break

	if M - stock >= 0:
		M -= stock
		ans += (stock * price)
	else:
		for i in range(stock):
			M -= 1
			ans += price
			if M == 0:
				print(ans)
				sys.exit()
print(ans)
N = int(input())
x = [0] * N
y = [0] * N
h = [0] * N
for i in range(N):
    x[i], y[i], h[i] = map(int, input().split())

top = [[] for _ in range(101*101)]

for i in range(101):
    for j in range(101):
        top[i*101+j] = [i, j]

#print(top)

H = 0

for i in range(len(top)):
    topx = top[i][0]
    topy = top[i][1]
    H = 0
    h_list = []
    for j in range(N):
        if h[j] != 0:
            tmp = abs(topx - x[j]) + abs(topy - y[j]) + h[j]
            h_list.append(tmp)
    if h_list.count(h_list[0]) == N - h.count(0) :
        ansx = topx
        ansy = topy
        ansH = h_list[0]
        break

print(ansx, ansy, ansH)


### FIXED CODE ###

N = int(input())
if N == 1 :
  print('Hello World')
else :
  a = int(input())
  b = int(input())
  print(a+b)
str = [int(i) for i in input().split()]
print(''.swapcase(<1200))

### FIXED CODE ###

s = input()
print(s.swapcase())
import math
n,m,*ab = map(int, open(0).read().split())

def calc():
    h = {}
    for i in range(0, n*2, 2):
        a = ab[i]
        b = ab[i+1]
        if a not in h:
            h[a] = set([b])
        else:
            h[a].add(b)
        if b not in h:
            h[b] = set([a])
        else:
            h[b].add(a)

    m = {}
    checked = set()
    def fill(k, d):
        if k in checked:
            return
        checked.add(k)
        if k in m:
            m[k] = min(m[k], d - 1)
        else:
            m[k] = d - 1
        for i in h[k]:
            if i in m:
                m[i] = min(m[i], d)
            else:
                m[i] = d
        for i in h[k]:
            fill(i, d+1)

    fill(1, 1)

    return [m[i] for i in range(2, n+1)]

ans = calc()
if ans is None:
    print("No")
else:
    print("Yes")
    print("\n".join(map(str, ans)))

### FIXED CODE ###

from collections import deque
n,m,*ab = map(int, open(0).read().split())

to = [[] for _ in range(n+1)]
ans = [None] * (n+1)
for i in range(0, m*2, 2):
    a = ab[i]
    b = ab[i+1]
    to[a].append(b)
    to[b].append(a)

q = deque([1])
while q:
    p = q.pop()
    children = to[p]
    for child in children:
        if ans[child] is None:
            ans[child] = p
            q.appendleft(child)

print("Yes")
print("\n".join(map(str, ans[2:])))
import sys

def main():
    input = sys.stdin.readline

    _, _, m = input().split()
    m = int(m)
    alist = input().split()
    blist = input().split()

    waribiki = [input().split() for _ in range(m)]
    
    res = [200000] * 200000
    count = 0
    for a in alist:
      for b in blist:
        res[count] = int(a) + int(b)
        count += 1

    # for i in range(m):
    #     res[count] = int(alist[int(waribiki[i][0])-1]) + int(blist[int(waribiki[i][1])-1]) - int(waribiki[i][2])
    #     count += 1
      
    print(min(res))


if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys

def main():
    input = sys.stdin.readline

    a, b, m = input().split()
    a, b, m = int(a), int(b), int(m)
    alist = list(map(int, input().split()))
    blist = list(map(int, input().split()))

    waribiki = [input().split() for _ in range(m)]
    
    res = [200000] * (m + 1)
    count = 0

    for i in range(m):
        res[count] = alist[int(waribiki[i][0])-1] + blist[int(waribiki[i][1])-1] - int(waribiki[i][2])
        count += 1

    res[count] = min(alist) + min(blist)
      
    print(min(res))


if __name__ == '__main__':
    main()
a=input()
b=input()

cmax = max((a+b),(a-b),(a*b))
print(cmax)

### FIXED CODE ###

a,b = map(int,input().split())
cmax = max((a+b),(a*b),(a-b))
print(cmax)
N = int(input())
if N == 1:
  print("Hello World")
else:
  A, B = list(map(int,input().split()))
  print(A + B)
  

### FIXED CODE ###

N = int(input())
if N == 1:
  print("Hello World")
else:
  A = int(input())
  B = int(input())
  print(A + B)
from collections import deque
import sys
sys.setrecursionlimit(10**7)
INTMAX = 9223372036854775807
INTMIN = -9223372036854775808
DVSR = 1000000007
def POW(x, y): return pow(x, y, DVSR)
def INV(x, d=DVSR): return pow(x, d - 2, d)
def DIV(x, y, d=DVSR): return (x * INV(y, d)) % d
def LI(): return [int(x) for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LS(): return input().split()
def II(): return int(input())
    
N,K=LI()
mp = {}
for i in range(N-1):
    a,b = LI()
    if not a in mp: mp[a] = []
    if not b in mp: mp[b] = []
    mp[a].append(b)
    mp[b].append(a)

QU = deque([])
visited = set([1])

fact=[1]*100010
for i in range(1,100010):
    fact[i] = fact[i-1]*i%DVSR

def ncr(n,r):
    return fact[n]*INV(fact[r])*INV(fact[n-r])

pat = ncr(K, len(mp[1])+1)*fact[len(mp[1])+1]%DVSR
for i in mp[1]:
    visited.add(i)
    QU.append((i, len(mp[i])))

# print("initial {}".format(pat))
while QU:
    vx, cnt = QU.popleft()
    # print(vx)
    nxcnt = len(mp[vx])
    notvisited = 0
    for nx in mp[vx]:
        if not nx in visited: notvisited +=1

    for nx in mp[vx]:
        if not nx in visited:
            QU.append((nx, nxcnt))
            visited.add(nx)
    # print("keisuu {} ncr {}C{}".format(keisuu,nxcnt+1-notvisited, notvisited))
    pat = pat*fact[notvisited]*ncr(K-(nxcnt+1-notvisited), notvisited)%DVSR

print(pat)


### FIXED CODE ###

from collections import deque
import sys
sys.setrecursionlimit(10**7)
INTMAX = 9223372036854775807
INTMIN = -9223372036854775808
DVSR = 1000000007
def POW(x, y): return pow(x, y, DVSR)
def INV(x, d=DVSR): return pow(x, d - 2, d)
def DIV(x, y, d=DVSR): return (x * INV(y, d)) % d
def LI(): return [int(x) for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LS(): return input().split()
def II(): return int(input())


N,K=LI()
mp = {}

if N == 1:
    print(K)
    exit()

for i in range(N-1):
    a,b = LI()
    if not a in mp: mp[a] = []
    if not b in mp: mp[b] = []
    mp[a].append(b)
    mp[b].append(a)

QU = deque([])
visited = set([1])

fact=[1]*(max(N,K)+1)
for i in range(1, max(N,K)+1):
    fact[i] = fact[i-1]*i%DVSR

def ncr(n,r):
    return fact[n]*INV(fact[r])*INV(fact[n-r])%DVSR

pat = ncr(K, len(mp[1])+1)*fact[len(mp[1])+1]%DVSR
for i in mp[1]:
    visited.add(i)
    QU.append(i)

# print("initial {}".format(pat))
while QU:
    vx = QU.popleft()
    # print(vx)
    nxcnt = len(mp[vx])
    if (nxcnt+1) > K:
        print(0)
        exit()
    notvisited = 0
    for nx in mp[vx]:
        if not nx in visited:
            QU.append(nx)
            visited.add(nx)
    pat = pat*fact[nxcnt-1]*ncr(K-2, nxcnt-1)%DVSR

print(pat)
a, b = map.(int, input().split())
if(a==b):
    print("Yes")
    else:
	print("No")

### FIXED CODE ###

a,b = input().split()
a = int(a)
b = int(b)
string = ""
if a>b:
    for i in range(a):
        string = string+str(b)
elif b>a:
    for i in range(b):
        string = string+str(a)
else:
    for i in range(a):
        string =  string+str(a)
print(string)
import math


def f(b, n):
    if n < b:
        return n
    else:
        return f(b, n//b) + n % b


def main():
    n = int(input())
    s = int(input())
    if s == 1:
        print(n)
        return
    elif s == n:
        print(n+1)
        return
    elif s > n:
        print(-1)
        return
    sqrt = -int(-math.sqrt(n))
    b = 2
    for b in range(2, sqrt+1):
        if f(b, n) == s:
            print(b)
            return
    for x in range(sqrt, 0, -1):
        y = s - x
        z = n - x
        b = z // y
        if z % y == 0 and f(b, n) == s:
            print(b)
            return
    print(-1)


if __name__ == "__main__":
    main()


### FIXED CODE ###

import math


def f(b, n):
    if n < b:
        return n
    else:
        return f(b, n//b) + n % b


def main():
    n = int(input())
    s = int(input())
    if s == n:
        print(n+1)
        return
    elif s > n:
        print(-1)
        return
    sqrt = int(math.sqrt(n))
    for b in range(2, sqrt+2):
        if f(b, n) == s:
            print(b)
            return
    for x in range(sqrt, 0, -1):
        if x > s:
            continue
        y = s - x
        b = (n - y) // x
        if b >= 2 and (n - y) % x == 0 and f(b, n) == s:
            print(b)
            return
    print(-1)


if __name__ == "__main__":
    main()
def SME():
    A = [[x,i] for i,x in enumerate(Whole)]
    A.sort()
    i = 1
    while i < len(A) - 1:
        if A[i+1][1]-A[i-1][1] < L :
            if A[i+1][0]==A[i-1][0] :
                del A[i][j]
                continue
        i += 1
    C = set([i for i in range(N)])
    D = set([])
    parameter = 0.997
    count = 0
    ANS = [None] * N
    for j in range(N) :
        a = A[j]
        for i,x in enumerate(ANS[a[1]:a[1]+L]):
            if x : continue
            else :
                ANS[a[1]+i] = a[0]
                D.add(a[1]+i)
                count += 1
        if count > N * parameter : break
    for i in C.difference(D):
        if i < L : ANS[i] = min(Whole[:i+1])
        else : ANS[i] = min(Whole[i+1-L:i+1])
    return ANS

[N,L] = [int(x) for x in input().split()]
Whole = [int(x) for x in input().split()]
ANS = SME()
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])
import sys
from collections import defaultdict
rl=sys.stdin.readline


def main():
    n,m=map(int,rl().strip().split())
    ewdata=[list(map(int,rl().strip().split())) for _ in range(m)]
    ew=dict(((x[0],x[1]),x[2]) for x in ewdata)
    ed=defaultdict(list)
    deg=defaultdict(int)
    memo=defaultdict(int)
    for x in ew:
        ed[x[0]].append(x[1])
        deg[x[0]]+=1
    prev=0
    curr=1
    scores=[0]*(n+2)
    cps=[0]*(n+1)
    maxscore=-10**14
    stack=[]
    c=1
    while memo[1]<deg[1]:
        if cps[curr]==0:
            cps[curr]=c
        else:
            if scores[c]-scores[cps[curr]]>0:
                maxscore='inf'
                break
            else:
                memo[prev]+=1
                curr=prev 
                prev=stack.pop()
                c-=1
                continue
        if curr==n:
            maxscore=max(scores[c],maxscore)
        if memo[curr]<deg[curr]:
            c+=1
            stack.append(prev)
            prev=curr
            curr=ed[curr][memo[curr]]
            scores[c]+=scores[c-1]+ew[(prev,curr)]
        else:
            scores[c]=0
            memo[curr]=0
            memo[prev]+=1
            cps[curr]=0
            cps[prev]=0
            curr=prev
            prev=stack.pop()
            c-=1
        # print(c,cps,stack)
        # print(c,cps,scores)
        # print(list(memo.items()),stack)
    # print(deg)
    print(maxscore)

if __name__=='__main__':
    main()



### FIXED CODE ###

import sys
rl=sys.stdin.readline

def main():
    n,m=map(int,rl().strip().split())
    eaw=[list(map(int,rl().strip().split())) for _ in range(m)]
    d=dict(((x[0]-1,x[1]-1),-x[2]) for x in eaw)
    inf=10**14
    mdl=[inf]*n
    mdl[0]=0
    def blrelax(dl,k):
        for _ in range(k):
            for e in iter(d):
                if dl[e[0]]+d[e]<dl[e[1]]:
                    dl[e[1]]=dl[e[0]]+d[e]
    blrelax(mdl,n-1)
    a1=mdl[n-1]
    blrelax(mdl,n)
    a2=mdl[n-1]
    if a1>a2:
        print('inf')
    else:
        print(-a1)
    
if __name__=='__main__':
    main()
import math
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
N = int(input())

all = 0
for i in range(2, N//2+1):
    basyo = combinations_count(N, i)  # iとN-iの時、値が同じ

    zero_iti  = 2 ** (3 * N - 2 * i - 1)  # i=iの時
    zero_iti2 = 2 ** (N + 2 * i - 1)      # i=N-iの時

    all += basyo * (zero_iti + zero_iti2)

if S % 2 == 0:  # i = Nが無いので足す
    basyo = combinations_count(N, N)
    zero_iti = 2 ** (N - 1)
    all += basyo * zero_iti

if S % 2 == 1:  # i = N-1も無いので足す
    basyo = combinations_count(N, N)
    zero_iti = 2 ** (N - 1)
    all += basyo * zero_iti

    basyo = combinations_count(N, N - 1)
    zero_iti = 2 ** (N - 2)
    all += basyo * zero_iti

print(int(all % (10**9+7)))

### FIXED CODE ###

N = int(input())
print((10**N - 9**N - 9**N + 8**N) % (10**9+7))
ok = [[0,4,8], [2,4,6], [0,1,2], [3,4,5], [6,7,8], [0,3,6], [1,4,7], [2,5,8]]
while True:
    s = input()
    if len(s) == 0:
        break
    flag = False
    for i in ok:
        if s[i[0]] == s[i[1]] == s[i[2]]:
            print(s[i[0]])
            flag = True
    if flag:
        continue
    print("d")

### FIXED CODE ###

ok = [[0,4,8], [2,4,6], [0,1,2], [3,4,5], [6,7,8], [0,3,6], [1,4,7], [2,5,8]]
while True:
    try:
        s = input()
    except EOFError:
        break
    flag = False
    for i in ok:
        if s[i[0]] == s[i[1]] == s[i[2]] and s[i[0]] != 's':
            print(s[i[0]])
            flag = True
            break
    if flag:
        continue
    print("d")
def main(A, dp, n):
    if n == -1:
        return dp[0]

    if (n in A) == False: 
        dp[n] = (dp[n + 1] + dp[n + 2]) % mod
    return main(A, dp, n-1)

N, M = map(int, input().split())
mod = 1000000007
dp = [0] * 10**5
A = [int(input()) for _ in range(M)] 
if (N-1 in A) == False:
    dp[N], dp[N-1] = 1, 1
else:
    dp[N] = 1
ans = main(A, dp, N-2)
print(ans)

### FIXED CODE ###

N, M = map(int, input().split())
mod = 1000000007
dp = [0] * (N+2)
A = set([int(input()) for _ in range(M)]) 
dp[-2] = 1

for i in range(N-1, -1, -1):
    if (i in A) == False:
        dp[i] = (dp[i + 1] + dp[i + 2]) % mod 

print(dp[0])
N = int(input())
A = int(input())
if N % 500 =< A:
    print('YES')
else:
    print('NO')


### FIXED CODE ###

N = int(input())
A = int(input())
if N % 500 <= A:
    print('Yes')
else:
    print('No')
s = list(input())
count = 0

if s[0] == "A":
    for i in range(2,len(s)-1):
        if s[i] == "C":
            count += 1
    if count != 1:
        print("WA")
        exit()
    else:
        number = s.index("C")
else:
    print("WA")
    exit()

s.remove(0)
s.remove(number)

for j in s:
    c = j.lower()
    if c == j:
        continue
    else:
        print("WA")
        exit()
print("AC")


### FIXED CODE ###

s = list(input())
count = 0

if s[0] == "A":
    for i in range(2,len(s)-1):
        if s[i] == "C":
            count += 1
    if count != 1:
        print("WA")
        exit()
    else:
        number = s.index("C")
else:
    print("WA")
    exit()

del s[number]
del s[0]

for j in s:
    c = j.lower()
    if c == j:
        continue
    else:
        print("WA")
        exit()
print("AC")
n = input()
if len(n) < 3:
  print(1000 - int(n))
else:
  hasuu = n[len(n) - 3:]
  if hasuu == '000':
    print('0')
  else:
    print(1000-int(hasuu)

### FIXED CODE ###

n = input()
if len(n) < 3:
  print(1000 - int(n))
else:
  hasuu = n[len(n) - 3:]
  if hasuu == '000':
    print('0')
  else:
    print(1000-int(hasuu))
N = int(input())
d = [int(input()) for k in range(N)]
sum = 0
for i in range(N):
    if i > 0:
        for j in range(i):
            sum = sum + d[i] * d[j]
print(sum)

### FIXED CODE ###

A, B = map(int, input().split())
if A - 2 * B < 0 or A-2*B == 0:
    print(0)
else:
    print(A - 2 * B)
while True:
    n = input()
    if n in ['a','e','i','o','u']:
        print 'vowel'
    else:
        print 'consonant'

### FIXED CODE ###

n = raw_input()
if n in ['a','e','i','o','u']:
    print 'vowel'
else:
    print 'consonant'
n = int(input())
a = []
for i in range(n):
  a.append(int(input()))
print(sum(a) - len(a))

### FIXED CODE ###

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

res = sum([i-1 for i in a])
print(res)
import copy as copy
s = input()

def func(val, n):
    if len(val) < 2:
        return n
    a=0
    b=0    
    if '01' in val:
        a = func(copy.copy(val.replace('01', '', 1)), n+2)
    if '10' in val:
        b = func(copy.copy(val.replace('10', '', 1)), n+2)
    
    return max(a, b, n)

print(func(s, 0))


### FIXED CODE ###

s = input()

print(min(s.count('0'), s.count('1'))*2)
N,X,T=map(int,input().split())
if N%X=0:
  print((N/X)*T)
else:
  print((N//X+1)*T)

### FIXED CODE ###

N,X,T=map(int,input().split())
if N%X==0:
  print((N//X)*T)
else:
  print((N//X+1)*T)
n, k = map(int, input().split())

print(min(n % k, n % abs(n - k)))

### FIXED CODE ###

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

if n > k:
    print(min(n % k, abs(n % k - k)))
elif n == k:
    print(0)
elif n < k:
    print(min(n, k - n))
N,L = list(map(int, input().split()))
l = []
l_abs = []
for i in range(N):
    l.append(L+i)
    l_abs.append(abs(L+i))


print(sum(l)-l[l.index(min(l_abs))])


### FIXED CODE ###

N,L = list(map(int, input().split()))
l = []
l_abs = []
for i in range(N):
    l.append(L+i)
    l_abs.append(abs(L+i))


print(sum(l)-l[l_abs.index(min(l_abs))])
import heapq

N, K = map(int, input().split(" "))
 
Ps = list(map(int, input().split(" ")))
Cs = list(map(int, input().split(" ")))


max_points = []
heapq.heapify(max_points)
for now_point in range(2, N+1):
    max_point = -float('inf')
    C_point = 0
    max_point = []
    heapq.heapify(max_point)
    for _ in range(K):
        next_point = Ps[now_point-1]
        C_point += Cs[next_point-1]
        
        heapq.heappush(max_point, -C_point)
        now_point = next_point
    
    max_point_ = heapq.heappop(max_point)
    heapq.heappush(max_points, max_point_)
 
print(-heapq.heappop(max_points))

### FIXED CODE ###

import re

S = input()

rrr = S.count("RRR")
rr = S.count("RR")
r = S.count("R")

if rrr == 1:
    print(3)
elif rr == 1:
    print(2)
elif r == 1 or r == 2:
    print(1)
else:
    print(0)
S,T=map(input().split())
A,B=map(int,input().split())
U=input()

if S==U:
    print(A-1,B)
if S==T:
    print(a,B-1)

### FIXED CODE ###

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

if S==U:
    print(A-1,B)
if T==U:
    print(A,B-1)
def test():
    n,k = map(int,input().split())
    a = int(n / k)
    b = int(n % a)

    if b == 0:
        print(b)
    else:
        print(abs(a-b))


if __name__ == "__main__":
    test()


### FIXED CODE ###

def test():
    n,k = map(int,input().split())
    print(0 if n % k == 0 else 1)


if __name__ == "__main__":
    test()