Harryxun/stf_run huggingface dataset:
import sys
sys.setrecursionlimit(100000)

def make_connected_group(G):
    C = [-1]*len(G)
    def main(G,i,grp):
        if C[i] > -1: return
        C[i] = grp
        for j in G[i]: main(G,j,grp)
    group = 0
    for p,cp in enumerate(C): 
        if cp == -1:
            main(G,p,group)
            group += 1
    return C


if __name__=='__main__':
    n,m = list(map(int,input().split()))
    G = [[] for _ in range(n)]
    for i,line in enumerate(sys.stdin):
        if not i < m:
            q = int(line)
            break
        s,t = list(map(int,line.split()))
        G[s].append(t)
        G[t].append(s)
    cn = make_connected_group(G)
    for j,line in enumerate(sys.stdin):
        if not j < q: break
        s,t = list(map(int,line.split()))
        print('yes' if cn[s] == cn[t] else 'no')

### FIXED CODE ###

import sys
 
def make_connected_group(G):
    C = [None]*len(G)
    group = 0
    for i,p in enumerate(C):
        if p != None: continue
        friends = [i]
        while len(friends) > 0:
            f = friends.pop()
            if C[f] == None:
                C[f] = group
                friends += G[f]
        group += 1
    return C
 
 
if __name__=='__main__':
    n,m = list(map(int,sys.stdin.readline().split()))
    G = [[] for _ in range(n)]
    for j,line in enumerate(sys.stdin):
        if not j < m:
            q = int(line)
            break
        s,t = list(map(int,line.split()))
        G[s].append(t)
        G[t].append(s)
    C = make_connected_group(G)
    for j,line in enumerate(sys.stdin):
        if not j < q: break
        s,t = list(map(int,line.split()))
        print('yes' if C[s] == C[t] else 'no')
i=1
while True:
    int(input())=x
    if x==0:
        break
   print("Case {}: {}".format(i,x))
   i+=1
   


### FIXED CODE ###

i=1
while True:
    x=int(input())
    if x==0:
        break
    print("Case {}: {}".format(i,x))
    i+=1
import math
import numpy as np
import re
import sys


def inputs():
    return [int(s) for s in input().split()]


def main():
    M1, _ = inputs()
    M2, _ = inputs()

    if (M1 + 1) % 12 == M2 % 12:
        return 1
    else:
        return 0


if __name__ == '__main__':
    print(main())


### FIXED CODE ###



def inputs():
    return [int(s) for s in input().split()]


def main():
    M1, _ = inputs()
    M2, _ = inputs()

    if (M1 + 1) % 12 == M2 % 12:
        return 1
    else:
        return 0


if __name__ == '__main__':
    print(main())
N, A, B=map(int, input().split())
print(min(A*T, B))

### FIXED CODE ###

N, A, B=map(int, input().split())
print(min(A*N, B))
import numpy as np
_ = input()
hoge = np.array(list(map(int, input().split())))

res = ''
for i in np.argsort(hoge):
  res += str(i) + ' '
print(res[:-1]

### FIXED CODE ###

import numpy as np
_ = input()
hoge = np.array(list(map(int, input().split())))

res = ''
for i in np.argsort(hoge):
  res += str(i + 1) + ' '
print(res[:-1])
a,b,c=map(int,input().split())
x=max(a,max(b,c))
input(a+b+c-x)

### FIXED CODE ###

da=list(map(int,input().split()))
x=-max(da)
for i in da:
    x+=i
print(x)
n=int(input())
a=list(map(int,input().split()))
m=10**9+7
b=[-1]*3
ans=1
for i in a:
  ans*=b.count(i-1)
  ans%=m
  b[b.index(i-1)]+=1
print(ans%m)

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
m=10**9+7
b=[0]*3
ans=1
for i in a:
  ans*=b.count(i)
  ans%=m
  for j in range(3):
    if b[j]==i:
      b[j]+=1
      break
print(ans%m)
n,m,s=map(int,input().split())
path=[[] for _ in range(n+1)]
coin=[(0,0)]
time=[float("inf") for _ in range(n+1)]
time[0]=0
queue=[]
for i in range(m):
    u,v,a,b=map(int,input().split())
    path[u].append((v,a,b))
    path[v].append((u,a,b))

for i in range(n):
    c,d=map(int,input().split())
    coin.append((c,d))

heapq.heappush(queue,(0,s,1))
while len(queue)!=0:
    t,c,v=heapq.heappop(queue)
    if max(time)<t:
        continue

    if time[v]>t:
        time[v]=t

    for nv,na,nb in path[v]:
        if na>c:
            continue
        else:
            heapq.heappush(queue,(t+nb,c-na,nv))
    heapq.heappush(queue,(t+coin[v][1],c+coin[v][0],v))
    
print(*time[2:],sep="\n")

### FIXED CODE ###

import heapq

n,m,s=map(int,input().split())
limit=2500
s=min(s,limit)
path=[[] for _ in range(n+1)]
coin=[(0,0)]
time=[[float("inf") for _ in range(limit+1)] for _ in range(n+1)]
queue=[]

for i in range(m):
    u,v,a,b=map(int,input().split())
    path[u].append((v,a,b))
    path[v].append((u,a,b))

for i in range(n):
    c,d=map(int,input().split())
    coin.append((c,d))

time[1][s]=0
heapq.heappush(queue,(0,1,s))

while len(queue)!=0:
    t,v,c=heapq.heappop(queue)
    for nv,na,nb in path[v]:
        if na>c:
            continue
        elif time[nv][c-na]<=t+nb:
            continue
        else:
            time[nv][c-na]=t+nb
            heapq.heappush(queue,(t+nb,nv,c-na))

    nc=min(c+coin[v][0],limit)
    nt=t+coin[v][1]
    if time[v][nc]<=nt:
        continue
    else:
        time[v][nc]=nt
        heapq.heappush(queue,(nt,v,nc))
    
for i in range(2,n+1):
    print(min(time[i]))
R = int(input())
if R < 1200:
    print("ABC")
eif R < 2800:
    print("ARC")
else:
    print("AGC")

### FIXED CODE ###

R = int(input())
if R < 1200:
    print("ABC")
elif R < 2800:
    print("ARC")
else:
    print("AGC")
import itertools

n,m = map(int,input().split())
comb = itertools.combinations
print(comb(n,2)+comb(m,2))

### FIXED CODE ###

import itertools

n,m = map(int,input().split())
comb = lambda x:x*(x-1)/2 if x >= 1 else 0
print(int(comb(n)+comb(m)))
from collections import Counter

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

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

l = Counter(prime_factorize(P))

ans = 1
min_l = min(l.items(), key=lambda x:x[0])
# print(min_l)

for i, v in l.items():
    if v >= N:
        ans *= i*(v//N)
#     print(ans)
# print(l)
print(ans)

### FIXED CODE ###

from collections import Counter

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

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

l = Counter(prime_factorize(P))

ans = 1

for i, v in l.items():
    if v >= N:
        ans *= i**(v//N)
#     print(ans)
# print(l)
print(ans)
l = map(int, raw_input().split())
print(int(l[0] * l[1] / 2)

### FIXED CODE ###

l = list(map(int, input().split()))
print(int(l[0] * l[1] / 2))
S = str(input())
K = int(input())
if S.count("1") == S(len):
    print(1)
    exit(0)
for s in S:
    if s != "1":
        print(s)
        exit()


### FIXED CODE ###

S = str(input())
K = int(input())
for i in range(0, K):
    if S[i] != "1":
        print(S[i])
        exit()
print(1)
N = int(input())

cnt = [0] * 6 * 10000 + 1

for x in range(1, 100):
    for y in range(1, 100):
        for z in range(1, 100):
            cnt[x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x] += 1

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


### FIXED CODE ###

import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy

N = int(input())

cnt = [0] * 10010

for x in range(1, 100):
    for y in range(1, 100):
        for z in range(1, 100):
            calc = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
            if calc <= N:
                cnt[calc] += 1

for i in range(1, N + 1):
    print(cnt[i])
N, M = map(int, input().split())
A = list(map(int, input().split()))
BC = {}
result_m = 0
for m in range(M):
  B, C = map(int, input().split())
  if BC.get(C) != None:
    BC[C] += B
  else:
    BC[C] = B
A.sort()
BC = sorted(BC.items(), reverse=True)
count = 0
for m in range(len(BC)):
  if count=>len(A):
    break
  if A[count]>BC[m][0]:
    break
  for i in range(BC[m][1]):
    if count=>len(A):
      break
    if BC[m][0] > A[count]:
      A[count] = BC[m][0]
      count+=1
print(sum(A))

### FIXED CODE ###

N, M = map(int, input().split())
A = list(map(int, input().split()))
BC = {}
result_m = 0
for m in range(M):
  B, C = map(int, input().split())
  if BC.get(C) != None:
    BC[C] += B
  else:
    BC[C] = B
A.sort()
BC = sorted(BC.items(), reverse=True)
count = 0
for m in range(len(BC)):
  if count>=len(A):
    break
  if A[count]>BC[m][0]:
    break
  for i in range(BC[m][1]):
    if count>=len(A):
      break
    if BC[m][0] > A[count]:
      A[count] = BC[m][0]
      count+=1
print(sum(A))
N = int(input())
L = list(map(int, input().split()))

from collections import Counter

c = Counter(L)
d = {}
sum = 0

for i in c:
    k = c(i)
    sum += k * (k-1) //2
for i in range(N):
    print(int(sum - c[L[i]] + 1))

### FIXED CODE ###

N,M = map(int, input().split())
print(int(N*(N-1)/2)+int(M*(M-1)/2))
s = input()
if s == "Sunny" :
  print("Cloudy")
elif s = "Cloudy":
  print("Rainy")
else :
  print("Sunny")
    
  

### FIXED CODE ###

s = input()
if s == "Sunny" :
  print("Cloudy")
elif s == "Cloudy":
  print("Rainy")
else :
  print("Sunny")
n= int(input())
a=int(str(n)[-1])

if a == 2, 4, 5, 7, 9:
  return "hon"
elif a == 0, 1, 6 or 8:
  return "pon"
else:
  return "bon"

### FIXED CODE ###

n = int(input())
a=int((str(n))[-1])
hon=[2,4,5,7,9]
pon=[0,1,6,8]
if a in hon:
  print("hon")
elif a in pon :
  print("pon")
else:
  print("bon")
import itertools as it
import sys

N, M = map(int, input().split())
if N==0 or M==0:
    print(0)
    sys.exit()
a=[]

for i in range(N):
    x,y=map(int,input().split())
    a.append([x,y])
    a.append([y,x])

ans=0
for e in it.permutations(range(N)):
    if e[0]!=0:
        break
        
    count=1
    for j in range(M-1):
        if [e[j]+1,e[j+1]+1] in a:
            count*=1
        else:
            count*=0
            break
            
    ans+=count

print(ans)

### FIXED CODE ###

import itertools as it
import sys

N, M = map(int, input().split())
if N==0 or M==0:
    print(0)
    sys.exit()
a=[]

for i in range(M):
    x,y=map(int,input().split())
    a.append([x,y])
    a.append([y,x])

ans=0
for e in it.permutations(range(N)):
    if e[0]!=0:
        break
        
    count=1
    for j in range(N-1):
        if [e[j]+1,e[j+1]+1] in a:
            count*=1
        else:
            count*=0
            break
            
    ans+=count

print(ans)
a = list(map(int,input().split()))
op = a[1]
x = a[0]
y = a[2]
 
if op == "+":
  print(x+y)
else:
  print(x-y)
  

### FIXED CODE ###

a,o,b=input().split()
a=int(a)
b=int(b)
print(a+b if o=="+" else a-b)
k, s = map(int, input().split())

ans = 0
num = max(k, s)

for i in range(num+1):
  for j in range(num+1):
    res = S - (i+j)
    if res >= 0:
      ans += res+1
      
print(ans)

### FIXED CODE ###

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

ans=[1 for x in range(K+1) for y in range(K+1) if 0<=S-x-y <= K]

print(len(ans))
A,B=map(int,input(.split())
print((A-1)*(B-1))

### FIXED CODE ###

A,B=map(int,input().split())
print((A-1)*(B-1))
n = int(input())
l = list(map(int,input().split()))
a = [0 for i in range(n)]
b = a
a_i = 0
b_i = 0
for i in l:
  if i%2 == 0:
    a[i]+=1
    if(a[a_i]<=a[i]):
      a_i=i
  else:
    b[i]+=1
    if(b[b_i]<=b[i]):
      b_i=i
a.sort()
a.reverse()
b.sort()
b.reverse()
if a_i == b_i:
  print(n-a[0]-b[0])
else:
  print(n-max(a[0]+b[1],a[1]+b[0]))

### FIXED CODE ###

n = int(input())
l = list(map(int,input().split()))
a = [0 for i in range(10**6)]
b = [0 for i in range(10**6)]
a_i = 0
b_i = 0
i = 0
for e in l:
    if i%2 == 0:
        a[e]+=1
        if(a[a_i]<=a[e]):
            a_i=e
    else:
        b[e]+=1
        if(b[b_i]<=b[e]):
            b_i=e
    i+=1
a.sort()
a.reverse()
b.sort()
b.reverse()
if a_i != b_i:
    print(n-a[0]-b[0])
else:
    print(n-max(a[0]+b[1],a[1]+b[0]))
import numpy as np

h, w, m = map(int, input().split())

# l = np.array([0]*(h*w))
l = [0]*(h*w)

for _ in range(m):
    h_input, w_input = map(int, input().split())
    # print((h_input-1)*w+w)
    # print(list(map(lambda x: x+1, l[(h_input-1)*w:(h_input-1)+w])))

    l[(h_input-1)*w:(h_input-1)*w+w] = list(map(lambda x: x+1, l[(h_input-1)*w:(h_input-1)*w+w]))

    # l = list(map(lambda a,b: x + z, x,y))
#     l[(h_input-1)*w:(h_input-1)*w+w] += 1
    l[w_input-1::w] =  list(map(lambda x: x+1, l[w_input-1::w]))
    l[(h_input-1)*w+w_input-1] -= 1
print(max(l))
 


### FIXED CODE ###

h, w, m = map(int, input().split())

h_bomb = [0 for i in range(h)]
w_bomb = [0 for i in range(w)]
bomb_list = []

for i in range(m):
    hb, wb = map(int, input().split())
    h_bomb[hb-1] += 1
    w_bomb[wb-1] += 1
    bomb_list.append(tuple([hb, wb]))

h_bomb_max = max(h_bomb)
w_bomb_max = max(w_bomb)
h_bomb_line = []
w_bomb_line = []

for i in range(h):
    if h_bomb[i] == h_bomb_max:
        h_bomb_line.append(i)

for i in range(w):
    if w_bomb[i] == w_bomb_max:
        w_bomb_line.append(i)

bomb_set = set(bomb_list)

for i in h_bomb_line:
    for j in w_bomb_line:
        if (i+1, j+1) not in bomb_set:
            print(h_bomb_max+w_bomb_max)
            exit()

print(h_bomb_max + w_bomb_max -1)
s = str(input())


a, b = 0, 0

for i in range(len(s)):
    if s[i] == s[i+1]:
        a, b = i+1, i+2
        break
        
if a == 0:
    print(-1, -1)
else:
    print(a, b)

### FIXED CODE ###

s = str(input())


a, b = 0, 0

for i in range(len(s)-1):
    if s[i] == s[i+1]:
        a, b = i+1, i+2
        break
    elif i < len(s)-2:
        if s[i] == s[i+2]:
            a, b = i+1, i+3
            break
        
if a == 0:
    print(-1, -1)
else:
    print(a, b)
a,b=map(int, input().split()) 
if (a+b)%3 ==0 or a%==0 or b%==0:
    print("Possible")
else:
    print("Impossible")

### FIXED CODE ###

a,b=map(int, input().split()) 
if (a+b)%3 ==0 or a%3==0 or b%3==0:
    print("Possible")
else:
    print("Impossible")
s = input()
t = input()

ans = 0
for i in range(3):
    if s[i]==t[i]:
        ans+=1
    i+=
print(ans)

### FIXED CODE ###

s = input()
t = input()

ans = 0
for i in range(3):
    if s[i]==t[i]:
        ans+=1
    i+=1
print(ans)
n=int(input())
s=list(input())
d=0
for i in range(n):
  if n-(i+1)>=2:
    
    if s[i]=='A' and s[i+1]=='B' and s[i+2]=='C':
      d+=1
  
print(c)    


### FIXED CODE ###

n=int(input())
s=list(input())
d=0
for i in range(n):
  if n-(i+1)>=2:
    if s[i]=='A' and s[i+1]=='B' and s[i+2]=='C':
      d+=1
  else:
    pass
print(d)
a,b=map(int,input().split())

if b == 1:
    print('0')
else:
  	cnt = 1
	b -= a
    while True:
        if b > 0:
            b -= (a - 1)
            cnt += 1
        else:
            print(cnt)
            break

### FIXED CODE ###

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

if b == 1:
  print('0')
else:
  cnt = 1
  b -= a
  while True:
    if b > 0:
      b -= (a - 1)
      cnt += 1
    else:
      print(cnt)
      break
a,b= map(str, input().split())
a = int(a*b)
b = int(b*a)

if a < b:
    print(a)
else:
    print(b)
# p = list(map(int,input().split()))

# count = 0
# val = sum(p[0:k])
# val_lis = [val]
# mx_val = val
# index = 0
# mx_index = 0
# for i,j in enumerate(p[k:]):
#     val = val - p[index] + j
#     val_lis.append(val)
#     index +=1
#     if val > mx_val:
#         mx_index = index
#         mx_val = val 
    
# ans = 0
# for i in range(k):
#     ans += ((p[mx_index + i]+1.0)*(p[mx_index+i]))/ (p[mx_index+i] *2.0)
# print(ans)  




# h = sorted(h,reverse = True)
# print(sum(h[k:]))

# s,t= map(str, input().split())
# a,b= map(int, input().split())
# u = input()
# print("x"*len(u))

# if(u == s):
#     print(a-1,b)
# else:
#     print(a,b-1)


### FIXED CODE ###

a,b= map(str, input().split())
ab = a*int(b)
ba = b*int(a)
if ab < ba:
    print(ab)
else:
    print(ba)
# p = list(map(int,input().split()))

# count = 0
# val = sum(p[0:k])
# val_lis = [val]
# mx_val = val
# index = 0
# mx_index = 0
# for i,j in enumerate(p[k:]):
#     val = val - p[index] + j
#     val_lis.append(val)
#     index +=1
#     if val > mx_val:
#         mx_index = index
#         mx_val = val 
    
# ans = 0
# for i in range(k):
#     ans += ((p[mx_index + i]+1.0)*(p[mx_index+i]))/ (p[mx_index+i] *2.0)
# print(ans)  




# h = sorted(h,reverse = True)
# print(sum(h[k:]))

# s,t= map(str, input().split())
# a,b= map(int, input().split())
# u = input()
# print("x"*len(u))

# if(u == s):
#     print(a-1,b)
# else:
#     print(a,b-1)
N = int(input())
A = map(int, input().split())

ret = 0
while(True):
  for(i=0; i<N; i++):
    if(A[i] % 2 != 0):
      break;
    else:
      A[i] /= 2
    ret += 1
print(ret)

### FIXED CODE ###

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

ret = 0
flag = True
while(flag):
  for i in range(N):
    if(A[i] % 2 != 0):
      flag = False
    else:
      A[i] /= 2
  if(flag):
    ret += 1  
print(ret)
from collections import deque

h, w = map(int, input().split())
field = []
for i in range(h):
    field.append(list(input()))

out = 0
for i in range(h):
    for j in range(w):
        if field[i][j] == '.':
            seen = [[0 for m in range(w)] for n in range(h)]
            seen[i][j] = 1
            q = deque([])
            q.append((i, j, 0))

            while q:
                y, x, cnt = q.popleft()
                # print(y, x, cnt)
                for ny, nx in (y, x + 1), (y, x - 1), (y + 1, x), (y - 1, x):
                    # if 0 <= ny < h and 0 <= nx < w and not seen[ny][nx]:
                    #     if field[ny][nx] == '.':
                    #         q.append((ny, nx, cnt + 1))
                    #         seen[y][x] = 1
                    if ny < 0 or ny >= h or nx < 0 or nx >= w:
                        pass
                    elif field[ny][nx] == '.' and seen[ny][nx] == 0:
                        q.append((ny, nx, cnt + 1))
                        seen[ny][nx] = 1
        out = max(out, cnt)
print(out)


### FIXED CODE ###

from collections import deque

h, w = map(int, input().split())
field = []

for i in range(h):
    field.append(list(input()))

out = 0
for i in range(h):
    for j in range(w):
        if field[i][j] == '.':
            seen = [[0 for m in range(w)] for n in range(h)]
            seen[i][j] = 1
            q = deque([])
            q.append((i, j, 0))
            while q:
                (y, x, cnt) = q.popleft()
                # print(y,x)
                # print(seen)
                for ny, nx in (y, x + 1), (y, x - 1), (y + 1, x), (y - 1, x):
                    if ny < 0 or ny >= h or nx < 0 or nx >= w:
                        pass
                    elif field[ny][nx] == '.' and seen[ny][nx] == 0:
                        q.append((ny, nx, cnt + 1))
                        seen[ny][nx] = 1

            out = max(out, cnt)
print(out)
from sys import stdin

test = list(stdin.readline().lstrip().rstrip())

count = [0,0]
i=0
before = 'R'

for str in test:
    if str=='R':
        count[i] += 1
    else:
        i = i + 1

print(max(count))

### FIXED CODE ###

from sys import stdin


test = list(stdin.readline().rstrip())

count = [0,0,0]
i=0
before = 'R'

for str in test:
    if str=='R':
        count[i] += 1
    else:
        i = i + 1

print(max(count))
a,b=map(str,input().split())
if a*b%2==0:
  print('Even')
else:
  print('Odd')

### FIXED CODE ###

a, b = map(int, input().split())
if(a*b%2 == 0 ):
  print('Even')
else:
  print('Odd')
n = int(input())
a = list(map(int, input().split()))
cnt = [0]*n
for i in a:
    cnt[i] += 1
total = 0
for i in cnt:
    total += i * (i-1) // 2
for i in a:
    print(total - (cnt[i] - 1))


### FIXED CODE ###

n = int(input())
a = [int(a)-1 for a in input().split()]
cnt = [0]*n
for i in a:
    cnt[i] += 1
total = 0
for i in cnt:
    total += i * (i-1) // 2
for i in a:
    print(total - (cnt[i] - 1))
N,M=map(int,input().split())
x=[int(i) for i in input().split()]
y=[int(i) for i in input().split()]
P=10**9+7
X=0
Y=0
for i in range(1,M+1):
  X+=x[i-1]*(2*i-1-M)
  X=X%P
for j in range(1,N+1):
  Y+=y[j-1]*(2*j-1-N)
  Y=Y%P
print((X*Y)%P)


### FIXED CODE ###

N,M=map(int,input().split())
x=[int(i) for i in input().split()]
y=[int(i) for i in input().split()]
P=10**9+7
X=0
Y=0
for i in range(1,N+1):
  X+=x[i-1]*(2*i-1-N)
  X=X%P
for j in range(1,M+1):
  Y+=y[j-1]*(2*j-1-M)
  Y=Y%P
print((X*Y)%P)
def main():
    n = int(input())
    a = list(map(int, input().split()))
    a_s = sorted(a)
    a_set = set(a_s)
    maxv = max(a)
    res = [0] * maxv
    rep = 0
    for i in a_s:
        if res[i-1] == 0:
            for j in range(i, maxv+1, i):
                res[j-1] += 1
        else:
            res[i-1] +=1
    cnt = 0
    for i in range(n):
        if res[a[i]-1] == 1:
            cnt += res[a[i]-1]
    print(cnt)

if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
    x = list(map(int, input().split()))
    ans = x.index(0) + 1
    print(ans)

if __name__ == '__main__':
    main()
W, a, b = map(int, input().split())
if a <= b <= a + W or a <= b + W <= a + W:
  prin(0)
  quit()

print(abs(a+W - b), abs(b+w - a))

### FIXED CODE ###

W, a, b = map(int, input().split())
if a <= b <= a + W or a <= b + W <= a + W:
  print(0)
  quit()

print(min(abs(a+W - b), abs(b+W - a)))
#!/usr/bin/env python3
import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
mans = inf ;ans = 0 ;count = 0 ;pro = 1

n,U,V = map(int,input().split())
U-=1;V-=1
G = [[] for i in range(n)]
for i in range(n-1):
  a,b = map(int,input().split())
  a-=1;b-=1
  G[a].append(b)
  G[b].append(a)
Aokidis = [0]*n
Takahashidis = [0]*n
def dfs(node,dis,TorA,pre):
  if TorA == "Takahashi":Takahashidis[node] = dis
  else:Aokidis[node] = dis
  for vi in G[node]:
    if vi == pre:continue
    dfs(vi,dis+1,TorA,node)
dfs(U,0,"Takahashi",-1)
dfs(V,0,"",-1)
for i in range(n):
  if Takahashidis[i] <= Aokidis[i]:
    ans = max(ans,Aokidis[i]-1)
print(ans)

### FIXED CODE ###

#!/usr/bin/env python3
import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
minans = inf ;ans = 0 ;count = 0 ;pro = 1
sys.setrecursionlimit(10**7)

n,u,v=map(int,input().split())
u-=1;v-=1
G=[[] for i in range(n)]
for i in range(n-1):
    a,b=map(int,input().split())
    a-=1;b-=1
    G[a].append(b)
    G[b].append(a)
D=[-1]*n
maxD=[-1]*n

def make_tree_dfs(n,d):
    D[n]=d
    tmp=0
    f=True
    for gi in G[n]:
        if D[gi]==-1:
            f=False
            tmp=max(tmp,make_tree_dfs(gi,d+1))
    if f: tmp=d
    maxD[n]=tmp
    return tmp

make_tree_dfs(v,0)
sdis=D[u]

def good_dfs(v,d,sdis):
    f=True
    for gi in G[v]:
        if D[gi]==d-1 and d-1>sdis-(d-1):
            return good_dfs(gi,d-1,sdis)
    return (maxD[v],d)

gd,orid=good_dfs(u,D[u],sdis)
k=orid-(sdis-orid)
print(gd-orid+(sdis-orid)+k-1)
# print(D)
# print(maxD)
# print(sdis,orid,gd,k)
sum=0
max=0
for i in range(5):
  x = int(input()）

### FIXED CODE ###

X=[int(input()) for i in range(5)]
Y=[]
for x in X:
  Y.append(-(-x//10)*10-x)
print(sum(X)+sum(Y)-(max(Y)))
a,b=map(int(input().split()))

print(a*b if 1<=a<=9 and 1<=b<=9 else -1)

### FIXED CODE ###

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

print(a*b if 1<=a<=9 and 1<=b<=9 else -1)
count = [0 for i in range(26)]
alpha = "abcdefghijklmnopqrstuvwxyz"
while True:
    sentence = input()
    if sentence == "":
        break
    for letter in sentence:
        letter.lower()
        num = 0
        for j in alpha:
            if letter == j:
                count[num] += 1
            else:
                num += 1
num = 0
for k in alpha:
    print(k + " : " + str(count[num]))
    num += 1


### FIXED CODE ###

import sys
s = sys.stdin.read().lower()
count = [0 for i in range(26)]
for j in s:
    num = ord(j) - ord('a')
    if num >= 0 and num <= 25:
        count[num] += 1
for k in range(26):
    print(chr(k + 97) + " : " + str(count[k]))