Harryxun/stf_run huggingface dataset:
import math
N,K = map(int,input().split())
if N > 5000:
  raise IndexError
cnt = 0
for n in range(1,N+1):
    if K/n <= 1:
        x = 0
    elif math.log(K/n)%math.log(2)<=0.00001:
        x = (math.log(K)-math.log(n))//math.log(2)
    else:
        x = (math.log(K)-math.log(n))//math.log(2)+1
    cnt += (0.5)**x
 
print(cnt/N)

### FIXED CODE ###

import math
N,K = map(int,input().split())
cnt = 0
for n in range(1,N+1):
    x = 0
    while n*(2**x) < K:
        x += 1
    cnt += (0.5)**x

print(cnt/N)
N = input()
word = [input() for i in range(N)]
sorted_word = [word[i].sort() for i in range(N)]
count = 0
for i in range(N):
  for j in range(i, N):
    if sorted_word[i] == sorted_word[i+j]:
      count += 1
print(count)




### FIXED CODE ###

N = int(input())
ans = 0
dict_word = {}
for i in range(N):
  sorted_word = str(''.join(sorted(list(input()))))
  try:
    ans += dict_word[sorted_word]
    dict_word[sorted_word] += 1
  except:
    dict_word[sorted_word] = 1
print(ans)
from collections import deque   #dequeはappendleftができるので。

letter = [0] + [chr(i) for i in range(97, 123)] #[0, a, b, c, ... , z]というリスト

N = int(input())

i = 0
n_24 = deque()

while N > 0:
    n_24.appendleft(N % 26)
    N = N // 26

ans = ''

for dig in (n_24):
    ans += letter[dig]

print(ans)

### FIXED CODE ###

from collections import deque  # dequeはappendleftができるので。

letter = ['z'] + [chr(i) for i in range(97, 123)]  # [0, a, b, c, ... , z]というリスト

N = int(input())

i = 0
n_24 = deque()

while N > 0:
    n_24.appendleft(N % 26)
    if N%26== 0:
        N -= 26
    N = N // 26

ans = ''

for dig in (n_24):
    ans += letter[dig]

print(ans)
import sys

N,M=map(int,input().split())
A=list(map(int,input().split()))
M=[0,2,5,5,4,5,6,3,7,6]

def match(i):
    ANS=0
    for s in str(i):
        ANS+=M[int(s)]

    return ANS
        

def dfs(i,NOW):
    if NOW==N:
        L=sorted(list(i),reverse=True)
        
        print("".join(L))
        sys.exit()
    elif NOW>N:
        return
    else:
        for a in A:
            dfs(i+str(a),NOW+M[a])


A.sort(reverse=True)
#print(A)
A.sort(key=lambda x:M[x])
#print(A)

dfs("",0)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**9)

N,M=map(int,input().split())
A=list(map(int,input().split()))
M=[0,2,5,5,4,5,6,3,7,6]

#まず最高何桁の数にできるか考えよう.

SET_A=set(A)

ANSLIST=[0]
def dfs(i,NOW):
    if ANSLIST[0]!=0:
        return
    ANS=0
    if NOW==N:
        L=sorted(list(i),reverse=True)
        #print(L)
        
        ANSLIST[0]=int(("".join(L)))
        return

    elif NOW>N:
        return 
    else:
        for a in A:
            dfs(i+str(a),NOW+M[a])


A.sort(reverse=True)
A.sort(key=lambda x:M[x])
dfs("",0)

x=ANSLIST[0]
stx=str(x)
from collections import Counter
counter=Counter(stx)


import itertools
for i,j,k in list(itertools.combinations(range(1,10),3)):
    for l,m,n in list(itertools.combinations(range(1,10),3)):
        if i in SET_A and j in SET_A and k in SET_A and l in SET_A and m in SET_A and n in SET_A and M[i]+M[j]+M[k]==M[l]+M[m]+M[n] and \
           counter[str(i)]>0 and counter[str(j)]>0 and counter[str(k)]>0 and (n>k or (n==k and m>j) or (n==k and m==j and l>i)):
                    x=min(counter[str(i)],counter[str(j)],counter[str(k)])
                    counter[str(i)]-=x
                    counter[str(j)]-=x
                    counter[str(k)]-=x
                    counter[str(l)]+=x
                    counter[str(m)]+=x
                    counter[str(n)]+=x

for i,j in list(itertools.combinations(range(1,10),2)):
    for l,m in list(itertools.combinations(range(1,10),2)):
        if i in SET_A and j in SET_A and l in SET_A and m in SET_A and M[i]+M[j]==M[l]+M[m] and \
           counter[str(i)]>0 and counter[str(j)]>0 and (m>j or (m==j and l>i)):
                    x=min(counter[str(i)],counter[str(j)])
                    counter[str(i)]-=x
                    counter[str(j)]-=x

                    counter[str(l)]+=x
                    counter[str(m)]+=x

for i in range(1,10):
    for l in range(1,10):
        if i in SET_A and l in SET_A and l>i and M[i]==M[l] and counter[str(i)]>0:
            counter[str(l)]+=counter[str(i)]
            counter[str(i)]=0



ANS=""
for i in range(9,-1,-1):
    ANS+=str(i)*counter[str(i)]

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

B = [A[0]]

for _ in range(1, N + 10):
    b = A[B[-1] - 1]
    if b in B:
        B += [b]
        break
    else:
        B += [b]
        continue

if len(B) >= K:
    print(B[K])
else:
    ind = [i for i, x in enumerate(B) if x == b]

    K = K - ind[0]
    mod = K % (ind[1] - ind[0])

    print(B[ind[0] + mod - 1])


### FIXED CODE ###

import sys

readline = sys.stdin.buffer.readline


def solver(N, K, A):
    i = 0
    i_list = [0]
    reached = [False for _ in range(N)]

    while True:
        next_i = A[i]

        if reached[next_i]:
            break

        reached[next_i] = True

        i_list.append(next_i)
        i = next_i

    m = i_list.index(next_i)

    if m >= K:
        return i_list[K] + 1

    le = len(i_list) - m
    K -= m
    ind = K % le

    return i_list[m + ind] + 1


def run():
    N, K = map(int, readline().split())
    A = list(map(int, readline().split()))
    A = [a - 1 for a in A]

    ans = solver(N, K, A)
    print(ans)


run()
#B
import math
n = int(input())
w = list(map(int, input().split()))
min=math.inf
for t in range(1,n):
    a = sum(w[:t])
    b = sum(w[t:])
    # print(a, b)
    if min > abs(a - b):
        min = abs(a - b)
print(min)

### FIXED CODE ###

#B
import math
n = int(input())
w = list(map(int, input().split()))
min=float('inf')
for t in range(1,n):
    a = sum(w[:t])
    b = sum(w[t:])
    # print(a, b)
    if min > abs(a - b):
        min = abs(a - b)
print(min)
N=input()
ans=0

for i in range(1,n+1):
  if len(str(i)) % 2 == 1:
      ans += 1
print(ans)

### FIXED CODE ###

n = int(input())
ans = 0

for i in range(1, n + 1):
  if len(str(i)) % 2 == 1:
    ans += 1

print(ans)
a,b=map(int,input().split())
print((int)a%b==0)

### FIXED CODE ###

a,b=map(int,input().split())
print(int(a%b!=0))
int main()
    {
        int a[100000]={0},i;
        int n,t;
        scanf("%d",&n);
        for(i=1;i<=n;i++)
        {
            scanf("%d",&t);
            a[t]=i;
        }
        
        for(i=1;i<=n;i++)
        printf("%d ",a[i]);

### FIXED CODE ###

n = int(input())

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

new_list = []

for i in range(1, n+1):
    new_list.append([enter[i-1], i])

new_list.sort()

for i in range(n):
    print(new_list[i][1], end = " ")
n = int(input())
A = list(map(int,input().split()))

b = 1
B=[0]*(n+1)
count = 0
for i in range(n):
    B[i] = b
    if 2*(b - A[i]) < A[i+1]:
        count += 1
    b = 2*(b - A[i])

B[n] = b

j = 0
while A[n] > B[j]:
    j+=1
    if j == B[len(B)-1]:
        break

total = 0
for i in range(j):
    total += B[i]

s = A[n]
for i in range(n-1,j-1,-1):
    total += min(B[i],s+A[i])
    s+=A[i]

if count==0:
    print(total+A[n])
else:
    print('-1')

### FIXED CODE ###

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

b = 1
B=[0]*(n+1)
count = 0

t=len(A)-1
for i in range(t):
    B[i] = b
    if 2*(b - A[i]) < A[i+1]:
        count += 1
        break
    b = 2*(b - A[i])
B[n] = b

if n == 0 and A[0] > 1:
    count += 1

j = 0
while count == 0 and A[t] > B[j]:
    if j == n:
        break
    j += 1

total = 0
for i in range(j):
    total += B[i]

s = A[t]
for i in range(t-1,j-1,-1):
    total += min(B[i],s+A[i])
    s+=A[i]

if count==0:
    print(total+A[t])
else:
    print('-1')
n = int(input())
a = list(map(int, input().split()))

count = [0] * (max(a)+1)

for i in a:
    count[i] += 1

max_n = 0
for j in range(1, len(count)-1):
    max_n = max(max_n, count[j] + count[j-1] + count[j+1])
max_n = max(max_n, count[-1] + count[-2])

print(max_n)


### FIXED CODE ###

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

def func(a):
  count = [0] * (max(a)+1)

  for i in a:
      count[i] += 1

  max_n = 0
  for j in range(1, len(count)-1):
      max_n = max(max_n, count[j] + count[j-1] + count[j+1])
  max_n = max(max_n, count[-1] + count[-2])

  return max_n

print(n if len(set(a)) == 1 else func(a))
N = int(input())
A = list(map(int, input().split()))


def solve(i, s, k, sign):
    if i == N:
        return k

    if sign * (s + A[i]) >= 0:
        return solve(i + 1, s + A[i], k, sign * -1)
    else:
        return solve(i + 1, sign, k + abs(s + A[i]) + 1, sign * -1)


print(min(solve(0, 0, 0, 1), solve(0, 0, 0, -1)))


### FIXED CODE ###

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

ret = float('inf')

sign = 1
s = 0
k = 0
for a in A:
    if sign * (s + a) > 0:
        s += a
    else:
        k += abs(s + a) + 1
        s = sign
    sign *= -1
ret = min(ret, k)

sign = -1
s = 0
k = 0
for a in A:
    if sign * (s + a) > 0:
        s += a
    else:
        k += abs(s + a) + 1
        s = sign
    sign *= -1

ret = min(ret, k)


print(ret)
alphabet = 'abcdefghijklmnopqrstuvwxyz'
from collections import defaultdict

adict = defaultdict(int)

while True:
    str_in = input().lower()
    if len(str_in) == 0:
        break
    for c in str_in:
        adict[c] += 1

for k in alphabet:
    print('%s : %i' %(k, adict[k]))

### FIXED CODE ###

alphabet = 'abcdefghijklmnopqrstuvwxyz'
from collections import defaultdict
import sys

adict = defaultdict(int)

for l in sys.stdin:
    for c in l.lower():
        adict[c] += 1
        
for k in alphabet:
    print('%s : %i' %(k, adict[k]))
a,v = map(int,input().split())
b,w = map(int,input().split())
t = int(input())
D=abs(a-b)
if t>=D/(v-w):
  print("YES")
else:
  print("NO")

### FIXED CODE ###

a,v = map(int,input().split())
b,w = map(int,input().split())
t = int(input())
 
point_div = abs(a-b)
speed_div = v-w
if speed_div * t >= point_div:
    print("YES")
else:
    print("NO")
import unittest
from solution import Solution


class TestSolution(unittest.TestCase):

    def test_001(self):
        # class under test
        solution = Solution()

        # actual
        N, A, B = 6, 2, 4

        actual = solution.solve(N, A, B)

        # expect
        expect = 2

        # assert
        self.assertEqual(actual, expect)

    def test_002(self):
        # class under test
        solution = Solution()

        # actual
        N, A, B = 10**18, 5, 5

        actual = solution.solve(N, A, B)

        # expect
        expect = 5 * 10**17

        # assert
        self.assertEqual(actual, expect)


if __name__ == '__main__':
    unittest.main()


### FIXED CODE ###

class Solution:
    def solve(self, N: int, A: int, B: int) -> int:

        return (N // (A+B)) * A + min(N % (A+B), A)


if __name__ == '__main__':

    # standard input
    N, A, B = map(int, input().split())

    # solve
    solution = Solution()
    print(solution.solve(N, A, B))
N = int(input())
p_list = list(int(pi) for pi in input().split(' '))

num_opposite = 0
indices = []

for i in range(N-1):
  p_1st = p_list[i]
  p_2nd = p_list[i+1]
  
  if p_1st<=p_2nd:
    pass
  else:
    num_opposite+=1
    if num_opposite==1:
      indices.append(i)
    else:
      indices.append(i+1)
      
  
  if num_opposite >=3:
    break 

if num_opposite == 0:
  print('YES')
elif num_opposite == 1:
  print('YES')
elif num_opposite == 2:
  small_idx = indices[0]
  large_idx = indices[1]
  
  p_small = p_list[small_idx]
  p_large = p_list[large_idx]
  
  if (p_small==p_list[large_idx-1]+1) and (p_large==p_list[small_idx+1]-1):
    print('YES')
  else:
    print('NO')
else:
  print('NO')

### FIXED CODE ###

A,B = [int(char) for char in input().split(' ')]

if (A+B)%2 != 0:
  print('IMPOSSIBLE')
else:
  print(int((A+B)/2))
#!/usr/bin/env python3
import sys


def solve(N: int, K: int, C: int, S: str):
    # 最善だったら何ケースか
    work = 0
    rest = 0
    startWork = -1
    girigiriIndices = []
    for i in range(N):
        if i == 15:
            print(f"i=15{rest}")
        if S[i] == "o" and rest <= 0:
            rest = C
            work += 1
            startWork = i
        else:
            rest -= 1
    rest = -1
    startWork = -1
    for i in range(N-1, -1, -1):
        if S[i] == "o" and rest <= 0:
            rest = C
            startWork = i
            girigiriIndices.append(i)
            print(f"i{i},{rest}")
        else:
            rest -= 1

    if work != K:
        print("")
        # print(work)
        exit()
    for i in girigiriIndices:
        print(i+1)
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    C = int(next(tokens))  # type: int
    S = next(tokens)  # type: str
    solve(N, K, C, S)


if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys


def solve(N: int, K: int, C: int, S: str):
    # 最善だったら何ケースか
    work = 0
    rest = 0
    startWork = -1
    leftIndices = set()
    rightIndices = set()
    for i in range(N):
        if S[i] == "o" and rest <= 0:
            rest = C
            work += 1
            leftIndices.add(i)
        else:
            rest -= 1
    if work != K:
        print("")
        exit()
    work = 0
    rest = 0
    for i in range(N-1, -1, -1):
        if S[i] == "o" and rest <= 0:
            rest = C
            work += 1
            rightIndices.add(i)
        else:
            rest -= 1
    for i in sorted(list(leftIndices.intersection(rightIndices))):
        print(i+1)
    # print(rightIndices)
    # rest = -1
    # startWork = -1
    # for i in range(N-1, -1, -1):
    #     if S[i] == "o" and rest <= 0:
    #         rest = C
    #         startWork = i
    #         girigiriIndices.append(i)
    #         print(f"i{i},{rest}")
    #     else:
    #         rest -= 1

    # if work != K:
    #     print("")
    #     # print(work)
    #     exit()
    # for i in girigiriIndices:
    #     print(i+1)
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    C = int(next(tokens))  # type: int
    S = next(tokens)  # type: str
    solve(N, K, C, S)


if __name__ == '__main__':
    main()
A,P=map(int,input().split())
print(((A*3)//2 + b//2) + (((A**3)%2 + b%2)//2))

### FIXED CODE ###

A,P=map(int,input().split())
print(((A*3)//2 + P//2) + (((A*3)%2 + P%2)//2))
n = int(input())
sum = 0

for i in range(1, n + 1):
    if i % 3 != 0 && i % 5 != 0:
        sum += i

print(sum)


### FIXED CODE ###

n = int(input())
sum = 0
for i in range(1, n+1):
    if i % 3 != 0 and i % 5 != 0:
        sum += i
print(sum)
n, k = map(int, input().split())
A = list(map(int, input().split()))

tentosu_f = 0
tentosu_l = 0

for i in range(len(A)):
    for j in range(i+1, len(A)):
        if A[i] > A[j]:
            tentosu_f += 1
          
for i in range(len(A)):
    for j in range(len(A)):
        if A[i] > A[j]:
            tentosu_l += 1
            
ans = int(tentosu_f * k) + int(k*(k-1) / 2 * tentosu_l)
print(ans%(10**9+7))

### FIXED CODE ###

# -*- coding: utf-8 -*-

# スペース区切りの整数の入力
m, d = map(int, input().split())
ans =0

for month in range(1, m+1):
    for i in range(22, d+1):
        d_list = list(str(i))
        d1   = int(d_list[1])
        d10 = int(d_list[0])
        if d1 < 2 or d10 < 2:
            continue
        if month == (d1 * d10):
            ans +=1

print(ans)
X = int(input())
while True:
  for i in range(1,N):
    if X % (i+1) == 0:
      break
    else:
      if i == N - 1:
        print(X)
        exit()
  X += 1
 


 
      
    


### FIXED CODE ###

X = int(input())
if X == 2:
    print(2)
    exit()
while True:
    N = int(X**0.5)
    for i in range(1,N):
        if X % (i+1) == 0:
            break
        else:
          if i == N - 1:
            print(X)
            exit()
    X += 1
n = int(input())
a = [int(i) for i in input().split()]
for i in range(n):
  a[i] -= (i+1)
ave = sum(a) // n
foi i in range(n):
  a[i] = abs(a[i] - ave)
print(sum(a))

### FIXED CODE ###

N = int(input())
A = [int(i) for i in input().split()]
A = [A[_] - (_ + 1) for _ in range(N)]
AA = sorted(A)
ans = 0
ans1 = 0
center = N // 2
num = AA[center]

if N % 2 != 0:
    for i in range(N):
        ans += abs(AA[i] - num)
    print(ans)
else:
    center = len(AA) // 2
    for i in range(N):
        ans += abs(AA[i]- num)
        ans1 += abs(AA[i]-(AA[center-1]))
    print(min(ans, ans1))
N = int(input())
A = list(map(int,input().split()))
PI = 1
for i in range(N):
    PI = PI*A[i]
if PI > 10**(18):
    print(-1)
    else:
      print(PI)

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
PI = 1
if 0 in A:
    PI = 0
else:
    for i in range(N):
        PI = PI*A[i]
        if PI > 10**(18):
            PI = -1
            break
print(PI)
s=input()
k=int(input())
d=dict()
if len(s)==1:
  print(s)
else:
  for i in range(len(s)-1):
    a=s[i]
    if a not in d:
      d[a]=0
    for j in range(i+1,len(s)):
      a+=s[j]
      if a not in d:
        d[a]=0
  l=list(d)
  l.sort()
  print(l[k-1])

### FIXED CODE ###

s=input()
k=int(input())
n=len(s)
ans=dict()
for i in range(n):
  t=str()
  for j in range(min(5,n-i)):
    t+=s[i+j]
    ans[t]=0
ans=sorted(list(ans.keys()))
print(ans[k-1])
#abc 161c
import math
n,k = map(int, input().split())
i = int(n/k)
ilow = i
iup = i+1
print(min(n,abs(n-k*iup),n-k*ilow))

### FIXED CODE ###

#abc 161a
a,b,c = map(int, input().split())
# abc -> bac -> cab
print(str(c)+' '+str(a)+' '+str(b))
import sys
import numpy as np

def main(A):
    return 0

def cc_export():
    from numba.pycc import CC
    cc = CC('my_module')
    cc.export('main', 'i8(i8[:])')(main)
    cc.compile()

if sys.argv[-1] == 'ONLINE_JUDGE':
    cc_export()
    exit(0)
if sys.argv[-1] != 'LOCAL':
    from my_module import main

A = np.ones(10, dtype=np.int32)
ans = main(A)
print(ans)


### FIXED CODE ###

from functools import lru_cache
import sys
sys.setrecursionlimit(10**7)

T = int(input())
INF = 10**18

for _ in range(T):
    N, A, B, C, D = map(int, input().split())
    V = set()

    @lru_cache(maxsize=None)
    def search(now):
        if now == 0:
            return 0

        ret = INF
        for div, cost in zip((2, 3, 5), (A, B, C)):
            q, r = divmod(now, div)
            ret = min(
                ret,
                search(q) + cost + r * D,
                search(q + 1) + cost + (div - r) * D if q + 1 < now else INF,
                now * D
            )
        return ret

    print(search(N))
# -*- coding:UTF-8 -*-
import sys

print(int(sys.argv[1]) ** 3)
print("\n")

### FIXED CODE ###

# -*- coding:UTF-8 -*-
print(int(input()) ** 3)
def comp(a,b):
  r=""
  for x,y in zip(a,b):
    if x==y:
      r += x
    elif y=="?":
      r += x
    elif x=="?":
      r += y
    else:
      return False
  return r

def merge(a,b):
  for i in range(len(a)-len(b)+1):
    m = comp(a[i:],b)
    if m:
      yield a[:i]+m+a[i+len(b):]
  
  for i in range(abs(lr),len(b)):
    m = comp(b[i:], a)
    if m:
      yield  b[:i]+m+a[len(b)-i:]
    m = comp(b, a[-len(b)+i:])
    if m:
      yield a[:-len(b)+i]+m+b[-i:]
  yield a+b
  yield b+a

def min_merge(a,b,c):
  a,b,c=sorted([a,b,c],key=len,reverse=True)
  ab = len(a)+len(b)
  abc = float("inf")
  for d in merge(a,b):
    if len(d) > abc:
      break
    l = len(next(merge(d, c)))
    abc = min(abc, l)
  if abc <= ab:
    return abc
  
  for i in range(1,min(len(c),abc-ab)):
    for j in range(1,len(c)):
      if comp(a[-j:]+"?"*i+b, c):
        return ab+i
      if comp(b[-j:]+"?"*i+a, c):
        return ab+i
  return abc

a=input()
b=input()
c=input()

print(min_merge(a,b,c))



### FIXED CODE ###

from itertools import *
from heapq import *

def comp(a,b):
  return all(x==y or "?" in (x,y) for x,y in zip(a, b))

def comp3(a,b,c):
  return 

def comp3(i,j,k,a,b,c):
  m = max(i,j,k)
  n = min(i+len(a),j+len(b),k+len(c))
  return all(len({x,y,z}-{"?"}) <= 1 for x,y,z in zip(a[m-i:n-i],b[m-j:n-j],c[m-k:n-k]))

def _merge_mid(a,b):
  la, lb = map(len,[a,b])
  for i in range(la-lb+1):
    if comp(a[i:],b):
      yield i

def merge_mid(a,b):
  return list(_merge_mid(a,b))

def _merge_right(a,b):
  la, lb = map(len,[a,b])
  for i in range(max(la-lb+1, 1),la):
    if comp(b, a[i-la:]):
      yield i
  yield la

def merge_right(a,b):
  return list(_merge_right(a,b))

class K(int):
  def __new__(cls, *args, **kwargs):
    cb = kwargs.pop("cb")
    i = int.__new__(cls, *args, **kwargs)
    i.cb = cb
    return i

def min_merge(a,b,c):
  keys = sorted([a,b,c],key=len,reverse=True)
  len_keys = list(map(len, keys))
  mid = {(i,j):merge_mid(keys[i],keys[j]) for i,j in permutations(range(3), 2)}
  right = {(i,j):merge_right(keys[i],keys[j]) for i,j in permutations(range(3), 2)}
  
  for i in mid[0,1]:
    for j in mid[0,2]:
      if j+len_keys[2] <= i or i+len_keys[2] <= j or (j-i in mid[1,2] or j-i in right[1,2] or i-j in right[2,1]):
        return len_keys[0]
  
  def candicates(a,b,c):
    return chain(
      (K(i+len_keys[b], cb=lambda:(
       (mid[a,c] and mid[a,c][0]+len_keys[c] <= i) or (mid[b,c] and len_keys[a] <= i+mid[b,c][-1]) or 
       any((i-j in right[c,b] if i>j else j-i in mid[b,c]) and comp3(0,i,j,keys[a],keys[b],keys[c]) for j in dropwhile((i-len_keys[c]).__gt__, mid[a,c]+right[a,c]))
      )) for i in dropwhile((len_keys[c]-len_keys[b]+1).__gt__, right[a,b])),
      (K(min(i+next(dropwhile((len_keys[a]-i+1).__gt__, y))+len_keys[b] for i in x), cb=lambda:True) for (x, y) in [sorted((right[a,c], right[c,b]), key=len)]),
    )
  
  can = merge(*(candicates(x,y,z) for x,y,z in permutations(range(3),3)))
  
  for k in can:
    if k.cb():
      return k
  
  return sum(len_keys)

a=input()
b=input()
c=input()

print(min_merge(a,b,c))
x = [int(v) for v in input().rstrip().split()
i = x.index(0)
print(i + 1)


### FIXED CODE ###

x = [int(v) for v in input().rstrip().split()]
i = x.index(0)
print(i + 1)
from math import sqrt
n=input()
for i in range(n):
	x1,y1,x2,y2,x3,y3=map(float,raw_input().split())
	A1=2*(x2-x1)
	B1=2*(y2-y1)
	C1=x2**2+y2**2-x1**2-y1**2
	x=((C1*B2)-(C2*B1))/((A1*B2)-(A2*B1))
	y=((A1*C2)-(A2*C1))/((A1*B2)-(A2*B1))
	a=sqrt((x2-x1)**2+(y2-y1)**2)
	b=sqrt((x3-x1)**2+(y3-y1)**2)
	c=sqrt((x3-x2)**2+(y3-y2)**2)
	p=(a+b+c)/2
	S=sqrt(p*(p-a)*(p-b)*(p-c))
	R=a*b*c/4/S
	print"%.3f %.3f %.3f"%(x,y,R)

### FIXED CODE ###

from math import sqrt
n=input()
for i in range(n):
	x1,y1,x2,y2,x3,y3=map(float,raw_input().split())
	A1=2*(x2-x1)
	B1=2*(y2-y1)
	C1=x2**2+y2**2-x1**2-y1**2
	A2=2*(x3-x2)
	B2=2*(y3-y2)
	C2=x3**2+y3**2-x2**2-y2**2
	x=(C1*B2-C2*B1)/(A1*B2-A2*B1)
	y=(A1*C2-A2*C1)/(A1*B2-A2*B1)
	R=sqrt((x1-x)**2+(y1-y)**2)
	print"%.3f %.3f %.3f"%(x,y,R)
table2 = {n:0 for n in "abcdefghijklmnopqrstuvwxyz"}
while True:
    x = str(input().lower())
    if x == "":
        break

    for i in x:
        if i in table2:
            table2[i] += 1

for m,n in table2.items():
    print("{0} : {1}".format(m,n))

### FIXED CODE ###

s=''
while True:
    try:
        s += input().lower()
    except:
        break
 
alph = "abcdefghijklmnopqrstuvwxyz"
 
for a in alph:
    print("{} : {}".format(a, s.count(a)))