Harryxun/stf_run huggingface dataset:
def main(N, A):
    num = 1
    ans = 1
    for i in range(N+1):
        num -= A[i]
        if i < N:
            num *= 2
            ans += num
        if num <= 0 and i < N:
            return -1
    eda = 0
    for i in range(N+1):
        ans -= num
        eda += A[N-i]
        num -= eda
        num = num//2
        if num <= 0:

            break
    return ans


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

print(main(N, A))


### FIXED CODE ###

from numba import njit


@njit
def main(h, m, H, M, K):
    return max((H-h)*60+(M-m)-K, 0)


h, m, H, M, K = map(int, input().split())


print(main(h, m, H, M, K))
def resolve():
    N, A, B = list(map(int, input().split()))
    line = ''
    for i in range(10 ** 100):
        if i > N:
            break
        if i % 2 == 0:
            line += 'b' * A
        else:
            line += 'r' * B

    print(line[:N].count('b'))

    return

resolve()

### FIXED CODE ###

def resolve():
    N, A, B = list(map(int, input().split()))
    ans = 0
    ans += N // (A + B) * A
    ans += min(N % (A+B), A)

    print(ans)

    return


resolve()
encode = {' ':'101', '\'':'000000', ',':'000011', '-':'1001000', '.':'010001', '?':'000001', 'A':'100101', 'B':'10011010', 'C':'0101', 'D':'0001', 'E':'110', 'F':'01001', 'G':'10011011', 'H':'010000', 'I':'0111', 'J':'10011000', 'K':'0110', 'L':'00100', 'M':'10011001', 'N':'10011110', 'O':'00101', 'P':'111', 'Q':'10011111', 'R':'1000', 'S':'00110', 'T':'00111', 'U':'10011100', 'V':'10011101', 'W':'000010', 'X':'10010010', 'Y':'10010011', 'X':'10010000'}
decode = {'00000':'A', '00001':'B', '00010':'C', '00011':'D', '00100':'E','00101':'F','00110':'G','00111':'H','01000':'I','01001':'J','01010':'K','01011':'L','01100':'M','01101':'N','01110':'O','01111':'P','10000':'Q','10001':'R','10010':'S','10011':'T','10100':'U','10101':'V','10110':'W','10111':'X','11000':'Y','11001':'Z','11010':' ','11011':'.','11100':',','11101':'-','11110':'\'','11111':'?'}

while True:
	try:
		string = list(raw_input())
		
		# encode
		code = ""
		for s in string:
			code += encode[s]
		i = 0
		tmp = []
		while i+5 <= len(code):
			tmp.append(code[i:i+5])
			code = code[i+5:]
		if len(code) != 0:
			code += '0' * (5 - len(code))
			tmp.append(code)

		# decode
		ans = ""
		for s in tmp:
			ans += decode[s]
		print ans
	except EOFError:
		break

### FIXED CODE ###

encode = {
' ':'101', 
"'":'000000', 
',':'000011', 
'-':'10010001', 
'.':'010001', 
'?':'000001', 
'A':'100101', 
'B':'10011010', 
'C':'0101', 
'D':'0001', 
'E':'110', 
'F':'01001', 
'G':'10011011', 
'H':'010000', 
'I':'0111', 
'J':'10011000', 
'K':'0110', 
'L':'00100', 
'M':'10011001', 
'N':'10011110', 
'O':'00101', 
'P':'111', 
'Q':'10011111', 
'R':'1000', 
'S':'00110', 
'T':'00111', 
'U':'10011100', 
'V':'10011101', 
'W':'000010', 
'X':'10010010', 
'Y':'10010011', 
'Z':'10010000'}

decode = {
"00000":"A",
"00001":"B",
"00010":"C",
"00011":"D",
"00100":"E",
"00101":"F",
"00110":"G",
"00111":"H",
"01000":"I",
"01001":"J",
"01010":"K",
"01011":"L",
"01100":"M",
"01101":"N",
"01110":"O",
"01111":"P",
"10000":"Q",
"10001":"R",
"10010":"S",
"10011":"T",
"10100":"U",
"10101":"V",
"10110":"W",
"10111":"X",
"11000":"Y",
"11001":"Z",
"11010":" ",
"11011":".",
"11100":",",
"11101":"-",
"11110":"'",
"11111":"?"}

while True:
	try:
		string = raw_input()
	except EOFError:
		break		

	e, ans = "", ""
	for s in string:
		e += encode[s]
	tmp = []
	while len(e) > 4:
		tmp.append(e[0:5])
		e = e[5:]
	if len(e) != 0:
		e += '0' * (5 - len(e))
		tmp.append(e)

	for s in tmp:
		ans += decode[s]
	print ans
N,M=map(int,input().split())
if N=M:
  print("Yes")
else:
  print("No")
 

### FIXED CODE ###

N,M=map(int,input().split())
if N==M:
  print("Yes")
else:
  print("No")
a,b = map(int, raw_input().split())
d = a / b
r = a % b
f = float(a) / float(b)
print " ".join(map(str, [d, r, "%.5f".f]))

### FIXED CODE ###

a,b = map(int, raw_input().split())
d = a / b
r = a % b
f = float(a) / float(b)
print " ".join([str(d), str(r), str('%.5f' % f)])
n = input()

if "7" in n:
  print("Yes")
  else:
    print("No")

### FIXED CODE ###

n = input()

if "7" in n:
  print("Yes")
else:
  print("No")
N = int(input())

ans = [0 for _ in range(10050)]
for x in range(1,int(N**0.5)):
    for y in range(1,int(N**0.5)):
        for z in range(1,int(N**0.5)):
            n = x**2 + y**2 + z**2 + x*y + y*z + z*x;
            ans[n] += 1

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

### FIXED CODE ###

n = int(input())
a = [0]*(n+1)
for i in range(1, 102):
    for j in range(1, 102):
        for k in range(1, 102):
            if (i*i + j*j + k*k + i*j + j*k + i*k) <= n:
                a[i*i + j*j + k*k + i*j + j*k + i*k] +=1
                
for x in a[1:]:
    print(x)
def main():
    N = int(sys.stdin.readline())
    p = list(map(int, input().split()))
    count = 0
    for i, n in enumerate(p, 1):
        if i == n:
            try:
                p[i], p[i] = p[i], p[i - 1]
                count += 1
            except:
                break
    print(count)

if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys

def main():
    N = int(sys.stdin.readline())
    p = list(map(int, input().split()))
    count = 0
    for i, n in enumerate(p, 1):
        if i == n:
            count += 1
            if len(p) != i:
                p[i - 1], p[i] = p[i], p[i - 1]
    print(count)

if __name__ == '__main__':
    main()
K = input()
x = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
for i in range 32:
    if K==i:
        print(x[i-1])

### FIXED CODE ###

K = int(input())
x = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(x[K-1])
α = int(input())
if str.isupper(α):
  print('A')
else:
  print('a')

### FIXED CODE ###

α = input()
if α.isupper():
  print('A')
else:
  print('a')
N = int(input())
T, A = map(int, input().split())
H = [int(input()) for i in range(N)]
print(H.index(min(abs(int(T - H[i] * 0.006) - A)) for i in range(N)))

### FIXED CODE ###

n = int(input())
t, a = map(int, input().split())
e = [int(i) for i in input().split()]

temp = []
for i in e:
    temp.append(abs(t - i * 0.006 - a))
    
print(temp.index(min(temp)) + 1)
import numpy as np
import sys
from collections import defaultdict
readline = sys.stdin.buffer.readline
# sys.setrecursionlimit(10**8)


def geta(fn=lambda s: s.decode()):
    return map(fn, readline().split())


def gete(fn=lambda s: s.decode()):
    return fn(readline().rstrip())


def main():
    n, m, k = geta(int)
    ca = np.array([0] + list(geta(int))).cumsum()
    cb = np.array([0] + list(geta(int))).cumsum()

    ans = 0
    for i in range(n+1):
        if ca[i] > k:
            break
        j = np.searchsorted(cb, k-ca[i], side="right") - 1
        if ans < i + j:
            ans = i + j

    print(ans)


if __name__ == "__main__":
    main()


### FIXED CODE ###

import numpy as np
import sys
from collections import defaultdict
readline = sys.stdin.buffer.readline
# sys.setrecursionlimit(10**8)


def geta(fn=lambda s: s.decode()):
    return map(fn, readline().split())


def gete(fn=lambda s: s.decode()):
    return fn(readline().rstrip())


def main():
    n, m, k = geta(int)
    a = np.array([0] + list(geta(int)))
    b = np.array([0] + list(geta(int)))

    ca = np.cumsum(a)
    cb = np.cumsum(b)

    ans = 0
    for i, ai in enumerate(ca):
        if k < ai:
            break

        j = np.searchsorted(cb, k-ai, side="right") - 1

        if ans < i + j:
            ans = i + j

    print(ans)


if __name__ == "__main__":
    main()
s = list(input())
k = int(input())

if s[0] == "1":
    print(s[1])
else:
    print(s[0])    

### FIXED CODE ###

s = input()
k = int(input())

ans = "1"
for i in range(k):
    if s[i]!="1":
        ans = s[i]
        break
    
print(ans)
s = input()
x, y = map(int, input().split())
hL = len(s)
L = 2 * hL

dp = [[False] * L for i in range(2)]

def next(i):
    global s
    while i < hL and s[i] != 'T':
        i += 1
    i += 1
    # print('i: %d' % i)
    return i

def c(x):
    global hL
    return x + hL

index = 0
t = 0
dp[0][c(0)] = True
dp[1][c(0)] = True
# print('\n'.join(map(str, dp)))
while index < hL:
    nt = (t + 1) % 2
    ndp = [False] * L
    ni = next(index)
    dx, index = ni - index - 1, ni
    for i in range(-hL, hL, 1):
        for j in [-1, 1]:
            if -hL <= i + j * dx < hL:
                nx = c(i + j * dx)
                ndp[nx] = ndp[nx] or dp[t][c(i)]
    dp[t] = ndp
    # print('\n'.join(map(str, dp)))
    t = nt
# print('\n'.join(map(str, dp)))
# print(dp[0][c(x)], dp[1][c(y)])
print('Yes' if dp[0][c(x)] and dp[1][c(y)] else 'No')


### FIXED CODE ###

s = input()
x, y = map(int, input().split())
hL = len(s)
L = 2 * hL

dp = [[False] * (L + 1) for i in range(2)]
ndp = [False] * (L + 1)

def next(i):
    global s
    while i < hL and s[i] != 'T':
        i += 1
    i += 1
    return i

def c(x):
    global hL
    return x + hL

index = 0
t = 0
js = [1]
dp[0][c(0)] = True
dp[1][c(0)] = True
mini, maxi = 0, 1
while index < hL:
    ni = next(index)
    dx, index = ni - index - 1, ni
    for i in range(mini, maxi):
        for j in js:
            if -hL <= i + j * dx <= hL:
                nx = c(i + j * dx)
                ndp[nx] = ndp[nx] or dp[t][c(i)]
    for i in range(mini, maxi):
        dp[t][c(i)] = False
    dp[t], ndp = ndp, dp[t]
    mini, maxi = mini - dx, maxi + dx
    js = [-1, 1]
    t = (t + 1) % 2
print('Yes' if dp[0][c(x)] and dp[1][c(y)] else 'No')
N = int(input())
a = list(map(int, input().split()))
cnt = [0]*(10**5+1)
for i in a:
    cnt[i] += 1
    cnt[i+1] += 1
    cnt[i+2] += 1
print(max(cnt))

### FIXED CODE ###

N = int(input())
a = list(map(int, input().split()))
cnt = [0]*(10**7)
for i in a:
    cnt[i-1] += 1
    cnt[i] += 1
    cnt[i+1] += 1
print(max(cnt))
N,K = map(int,input().split())
V = list(map(int,input().split()))

if N < K:
    ans = sum(V)
    V = sorted(V)
    i = 0
    while True:
        if V[i] >= 0:
            break
        ans += abs(V[i])
        i += 1
    print(ans)
    exit()


ans = 0
for a in range(K,-1,-1):
    for i in range(a+1):
        left = V[:a-i]
        if i != 0:
            right = V[-i:]
        else:
            right = []
        print(left,right)
        lr = sorted(left+right)
        tans = sum(lr)
        for j in range(min(len(lr),K-a)):
            if lr[j] < 0:
                tans += abs(lr[j])
        ans = max(ans , tans)
print(ans)


### FIXED CODE ###

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

if N < K:
    ans = sum(V)
    V = sorted(V)
    i = 0
    while len(V) > i:
        if V[i] >= 0:
            break
        ans += abs(V[i])
        i += 1
    print(ans)
    exit()


ans = 0
for a in range(K,-1,-1):
    for i in range(a+1):
        left = V[:a-i]
        if i != 0:
            right = V[-i:]
        else:
            right = []
        lr = sorted(left+right)
        tans = sum(lr)
        for j in range(min(len(lr),K-a)):
            if lr[j] < 0:
                tans += abs(lr[j])
        ans = max(ans , tans)
print(ans)
n,m = int(input()), int(input())
if (n==m):
  print("yes")
else: 
  print("no")

### FIXED CODE ###

n,m = map(int,input().split())
if n==m:
  print("Yes")
else:
  print("No")
import numpy as np

n,m=map(int,input().split())
E=[]
W=[]
node_l=np.zeros(n)
node_l[0]=1
for i in range(m):
    u,v,w=map(int,input().split())
    #print(u,v,w)
    E.append([u,v])
    W.append(w)
#print(E,W)

def bfs(node,node_l,l,w_l):
    i=0
    A=[]
    L=[]
    for edge in l:
        if edge[0]==node and node_l[edge[1]-1]==0:
            L.append(edge[1])
            A.append(i)
        elif edge[1]==node and node_l[edge[0]-1]==0:
            L.append(edge[0])
            A.append(i)
        i+=1
    if L==[]:
        return
    for j in range(len(L)):
        if W[A[j]]%2==0:
            node_l[L[j]-1]=node_l[node-1]
            bfs(L[j],node_l,l,w_l)
        else:
            node_l[L[j]-1]=node_l[node-1]*-1
            bfs(L[j],node_l,l,w_l)
    return
bfs(1,node_l,E,W)
for i in range(n):
    if node_l[i]==1:
        print('1',end='\n')
    else:
        print('0',end='\n')


### FIXED CODE ###

import numpy as np

n=int(input())
E=[]
node_l=np.zeros(n)
node_l[0]=1
for i in range(n-1):
    u,v,w=map(int,input().split())
    #print(u,v,w)
    E.append((u,v,w))
#print(E,W)

def bfs(node,l):
    root=[[] for i in range(n)]
    for a,b,c in l:
        root[a-1]+=[(b-1,c)]
        root[b-1]+=[(a-1,c)]
    stack=[]
    stack.append(node-1)
    #print(root)
    dist=[-1]*n
    dist[node-1]=0
    while stack:
        #print(stack)
        buf=stack.pop(-1)
        for v,weight in root[buf]:
            if dist[v]==-1:
                dist[v]=dist[buf]+weight
                stack.append(v)
    return dist

for i in bfs(1,E):
    print(i%2,end='\n')
N = int(input())
a = list(map(int, input().split()))

cnt = [0 for i in range(8)]
count = 0

for i in range(N):
    if 1<= a[i] <= 399:
        cnt[0] = 1
    elif 400<=a[i]<=799:
        cnt[1] = 1
    elif 800<=a[i]<=1199:
        cnt[2] = 1
    elif 1200<=a[i]<=1599:
        cnt[3] = 1
    elif 1600<=a[i]<=1999:
        cnt[4] = 1
    elif 2000<=a[i]<=2399:
        cnt[5] = 1
    elif 2400<=a[i]<=2799:
        cnt[6] = 1
    elif 2800<=a[i]<=3199:
        cnt[7] = 1
    else:
        count += 1

ans_min = sum(cnt)
ans_max = ans_min + count

print("{} {}".format(max(1,ans_min), ans_max))

### FIXED CODE ###

r, g, b= map(int, input().split())

ans = 10*g+b

if ans % 4==0:
    print("YES")
else:
    print("NO")
n, l = map(int, input().split())
List = sorted([input() for i in range(n])
print("".join(List))

### FIXED CODE ###

n, l = map(int, input().split())
List = sorted([input() for i in range(n)])
print("".join(List))
inp = input()
if inp == 1:
print(0)
else:
print(1)

### FIXED CODE ###

if int(input())==1:
    print(0)
else:
    print(1)
from fractions import gcd
from functools import reduce


def lcm(a, b):
    return a * b // gcd(a, b)


def solve(string):
    n, m, *a = map(int, string.split())
    c = 2**len(bin(a[0]).split("1")[-1])
    l = reduce(lcm, (0 if _a % c or not _a // c % 2 else _a for _a in a))
    return str((m - l // 2) // l + 1) if l else "0"


if __name__ == '__main__':
    import sys
    print(solve(sys.stdin.read().strip()))


### FIXED CODE ###

from fractions import gcd
from functools import reduce


def lcm(a, b):
    return a * b // gcd(a, b)


def solve(string):
    n, m, *a = map(int, string.split())
    c = 0
    for _a in a:
        if not c:
            while _a % 2 == 0:
                _a //= 2
                c += 1
        else:
            t = 0
            while _a % 2 == 0:
                _a //= 2
                t += 1
            if c != t:
                return "0"
    l = reduce(lcm, a)
    return str(max((m - l // 2) // l + 1, 0))


if __name__ == '__main__':
    import sys
    print(solve(sys.stdin.read().strip()))
N=int(input())
list=[str(i) for i in [11, 31, 41, 61, 71, 101, 131, 151, 181, 191, 211, 241, 251, 271, 281, 311, 331, 401, 421, 431, 461, 491, 521, 541, 571, 601, 631, 641, 661, 691, 701, 751, 761, 811, 821, 881, 911, 941, 971, 991, 1021, 1031, 1051, 1061, 1091, 1151, 1171, 1181, 1201, 1231, 1291, 1301, 1321, 1361, 1381]]
print(" ".join(list[:N]))

### FIXED CODE ###

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

if a <= b:
    print(a)
else:
    print(a-1)
S = input().split()

A = int(S[0])
B = int(S[1])
C = int(S[2])
D = int(S[3])

count_U = B - A + 1

#count_C  = CountDivisibleNumber(C, A, B)
#print(count_C)
#count_D  = CountDivisibleNumber(D, A, B)
#print(count_D)
#count_CD = CountDivisibleNumber(lcm(C, D), A, B)
#print(count_CD)

count_C = math.floor((B // C) - (A // C))
count_D = math.floor((B // D) - (A // D))
CD = lcm(C, D)
count_CD = math.floor((B // CD) - (A // CD))

print(count_U - (count_C + count_D - count_CD))

### FIXED CODE ###

def gcd(a, b):
	while b:
		a, b = b, a % b
	return a
    
S = input().split()

A = int(S[0])
B = int(S[1])
C = int(S[2])
D = int(S[3])

CD = (C * D) // gcd(C, D)

count_B = B - (B // C) - (B // D) + (B // CD)
count_A = A - 1 - ((A - 1) // C) - ((A - 1) // D) + ((A - 1) // CD)

print(count_B - count_A)
a,b,c,d = input().split()

if a == b and b != c and c == d:
  print('Yes')
elif a == c and b != c and b == d:
  print('Yes')
elif a == d and a != b and b == c:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

w = input()
a = w[0]
b = w[1]
c = w[2]
d = w[3]
 
if a == b and b != c and c == d:
  print('Yes')
elif a == c and b != c and b == d:
  print('Yes')
elif a == d and a != b and b == c:
  print('Yes')
else:
  print('No')
H,W = map(int,input().split())
grid = [[0]*W]*H
for h in range(H):
  row = input.split()
  for w,r in enumerate(row):
    if r == "#":
      if h>=1:
        grid[h-1][w] += 1
        if w>=1:
          grid[h-1][w-1] += 1
        if w<=W-1:
          grid[h-1][w+1] += 1
      if h<=H-1:
        grid[h+1][w] += 1
        if w>=1:
          grid[h+1][w-1] += 1
        if w<=W-1:
          grid[h+1][w+1] += 1
      if w>=1:
        grid[h][w-1] +=1
      if w<=W-1:
        grid[h][w+1] +=1
  grid.append([0 if v == "." else "#" for v in input().split()])
for g in grid:
  print("".join([str(v) for v in g])


### FIXED CODE ###

H,W = map(int,input().split())
grid = [[0 for w in range(W)] for h in range(H)]
sharps = []
for h in range(H):
  row = [v for v in input()]
  #print(row)
  for w,r in enumerate(row):
    #print(w,r)
    if r == "#":
      #grid[h][w] = "#"
      sharps.append([h,w])
      if h>=1:
        grid[h-1][w] += 1
        if w>=1:
          grid[h-1][w-1] += 1
        if w<=W-2:
          grid[h-1][w+1] += 1
      if h<=H-2:
        grid[h+1][w] += 1
        if w>=1:
          grid[h+1][w-1] += 1
        if w<=W-2:
          grid[h+1][w+1] += 1
      if w>=1:
        grid[h][w-1] +=1
      if w<=W-2:
        grid[h][w+1] +=1
#print(sharps)
for sharp in sharps:
  grid[sharp[0]][sharp[1]] = "#"
for g in grid:
  print("".join([str(v) for v in g]))
N=int(input())
A=[map(int, input().split())]
sortedA=sorted(A, reverse=True)
Bob=0
Alice=0
for i in range(len(A)):
  # print(i)
  if i == 0 or i%2==0:
    Alice+=sortedA[i]
  else:
    Bob +=sortedA[i]
print(Alice-Bob)


### FIXED CODE ###

N=int(input())
A=list(map(int, input().split()))
sortedA=sorted(A, reverse=True)
Bob=0
Alice=0
for i in range(len(A)):
  # print(i)
  if i == 0 or i%2==0:
    Alice+=sortedA[i]
  else:
    Bob +=sortedA[i]
print(Alice-Bob)
n, k = map(int,input().split())
ab = [input().split() for i in range(n)]

ans = ""

for i in ab:
  ans += i[0] * int(i[1])

print(ans[k])

### FIXED CODE ###

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

ab = sorted(ab, key=lambda k:k[0])

b = 0

for i in ab:
  b += i[1]
  if b >= k:
    print(i[0])
    exit()
print(int(input()) + int(input()) if int(input()) == 2 else "Hello World
")

### FIXED CODE ###

N = int(input())
if N == 1:
  print('Hello World')
else:
  A = int(input())
  B = int(input())
  print(A+B)
A = int(input())
B = int(input())
print(str(max(A+B,A-B,A*B)))


### FIXED CODE ###

A,B = map(int, input().split())
print(max(A+B,A-B,A*B))
import sys
input = sys.stdin.readline
N = int(input())
= []
S_append = S.append
S = [input() for _ in range(N)]
count = 0
while len(S) >0:
  S.remove(S[0])
  count += 1
 
print(count)

### FIXED CODE ###

N = int(input())
S = list()
for i in range(N):
  x = input()
  S.append(x)
  
A = set(S)
print(len(A))
from fractions import gcd
from math import gcd
N = int(input())
A = list(map(int,input().split()))
ans = A[0]
for i in A[1:]:
    ans = gcd(ans,i)
    if ans ==1:
        break
print(ans)


### FIXED CODE ###

from fractions import gcd
#from math import gcd
N = int(input())
A = list(map(int,input().split()))
ans = A[0]
for i in A[1:]:
    ans = gcd(ans,i)
    if ans ==1:
        break
print(ans)
from math import ceil
time=[int(input())for i in range(5)]
mod=[i%10 for i in time]
a=124
res=0
for i in range(len(mod)):
    if mod[i] !=0:
        a=min(a,mod[i])
for i in range(5):
    if i==mod.index(a):
        res+=time[i]
    else:
        res+=ceil(time[i]/10)*10
print(res)

### FIXED CODE ###

from math import ceil
time=[int(input())for i in range(5)]
mod=[i%10 for i in time]
a=124
res=0
for i in range(len(mod)):
    if mod[i] !=0:
        a=min(a,mod[i])
if a==124:
    a=0
for i in range(5):
    if i==mod.index(a):
        res+=time[i]
    else:
        res+=ceil(time[i]/10)*10
print(res)
import sys

l = []

for line in sys.stdin:
  new_list = [int(elem) for elem in line.split()]
  l.append(new_list)
f=[]
i=1
for x in range(0,len(l)):
  
  f[x] = l[-i]
  i++
print(f)

### FIXED CODE ###

from sys import stdin, stdout
l = list(map(int, stdin.readline().rstrip().split(' ')))
f=[]
i=-1
n = 0
while(n<len(l)):
  f.append(l[i])
  i = i+1
  n= n+1
print(*f,sep=" ")
n, m = map(int, input().split())
c = [False for i in range(199999)]
d = [False for i in range(199999)]
for i in range(m):
	a, b = map(int, input().split())
	if a == 1:
		c[b] = True
	if b == n:
		d[a] = True
for i in range(199999):
	if c[i] and d[i]:
		print ("POSSIBLE")
		exit()
print ("IMPOSSIBLE")

### FIXED CODE ###

n, m = map(int, input().split())
#2次元配列
#a=[list(map(int,input().split())) for i in range(m)]

aa = []
bb = []
for i in range (m):
	a, b = map(int, input().split())
	if(a == 1):
		aa.append(b)
	if(b == n):
		bb.append(a)

if( len(set(aa) & set(bb)) == 0):
	print ("IMPOSSIBLE")
else:
	print ("POSSIBLE")
from scipy.sparse.csgraph import shortest_path, dijkstra
import numpy as np

N = int(input())
L = np.zeros((N,N))
for i in range(N-1):
  a, b, c = map(int, input().split())
  L[a-1][b-1] = c
  L[b-1][a-1] = c

Q, K = map(int, input().split())
K -= 1
L1 = dijkstra(L, indices = K)
for i in range(Q):
  x, y = map(int, input().split())
  x -= 1
  y -= 1

  print (int(L1[x] + L1[y]))

### FIXED CODE ###

from collections import defaultdict as dd
from collections import deque
N = int(input())
D =dd(list)
for i in range(N-1):
  a, b, c = map(int, input().split())
  D[a-1].append((b-1, c))
  D[b-1].append((a-1, c))

Q, K = map(int, input().split())
K -= 1
L = [0 for _ in range(N)]
q = deque([])
q.append(K)
while len(q) > 0:
  a = q.pop()
  for b, c in D[a]:
    if L[b] == 0:
      L[b] = L[a] + c
      q.append(b)

for i in range(Q):
  x, y = map(int, input().split())
  print (L[x-1] + L[y-1])
n,k = int(input())
p = list(map(int,input().split()))

p.sort()
ans = 0
for i in range(k):
  ans += p[i]
print(ans)

### FIXED CODE ###

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

p.sort()
ans = 0
for i in range(k):
  ans += p[i]
print(ans)
n,k = map(int,input().split())
a = list(map(int,input().split()))

if n == k:
    print(1)
    exit()

l = 0
r = 0
one = False
for i in range(n):
    if a[i] == 1:
        one = True
        continue
    if one == False:
        l += 1
    else:
        r += 1

if k >= min(l+1,r+1):
    n -= k
    if n%(k-1) == 0:
        n //= k-1
    else:
        n //= k-1
        n += 1
    pritn(n+1)
else:
    if l % (k-1) == 0:
        l //= k-1
    else:
        l //= k-1
        l += 1
        
    if r % (k-1) == 0:
        r //= k-1
    else:
        r //= k-1
        r += 1
    print(l+r)

### FIXED CODE ###

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

if n == k:
    print(1)
    exit()
    
n -= k
if n % (k-1) == 0:
    n //= k-1
else:
    n //= k-1
    n += 1
print(n+1)
X,N = map(int,input().split())
P = list(map(int,input().split()))

# 0,101は含まなければいけない
P_n = [i for i in range(0,102,1) if i not in P]
abs_value = [abs(X-P_n[j]) for j in range(len(P_n))]


min_abs = min(abs_value)
for k in range(len(abs_value)):
    if abs_value[k] == min_abs:
        print(P_n[k])
        break

### FIXED CODE ###

X = [int(x) for x in input().split()]

print(X.index(0)+1)