Harryxun/stf_run huggingface dataset:
n, x = map(int, input().split())
l = list(map(int, input().split()))
countBound = 0
coordinate = 0
# print(l)

while countBound <= n + 1:
    coordinate += l[countBound]
    countBound += 1
    if coordinate > x:
        break
    else:
        continue

print(countBound)


### FIXED CODE ###

def bound(n, x, l):
    coordinate = 0
    for i in range(n):
        coordinate += l[i]
        if x < coordinate:
            return i
        else:
            continue
    return n


n, x = map(int, input().split())
l = list(map(int, input().split()))
countbound = bound(n, x, l)
print(countbound+1)
a=sum(i%2^int(c)for i,c in enumerate(input()));print(min(a,n-a))

### FIXED CODE ###

s = input()
res1, res2 = 0, 0
for i, j in enumerate(s):
    if i % 2 == 0:
        if j == '0':
            res1 += 1
    else:
        if j == '1':
            res1 += 1
for i, j in enumerate(s):
    if i % 2 == 1:
        if j == '0':
            res2 += 1
    else:
        if j == '1':
            res2 += 1
print(min(res1, res2))
n = int(input())
A = [input() for _ in range(n)]
print("AC x "+ A.count("AC"))
print("WA x "+ A.count("WA"))
print("TLE x "+ A.count("TLE"))
print("RE x "+ A.count("RE"))


### FIXED CODE ###

n = int(input())
A = [input() for _ in range(n)]

print("AC x " + str(A.count("AC")))
print("WA x " + str(A.count("WA")))
print("TLE x " + str(A.count("TLE")))
print("RE x " + str(A.count("RE")))
s = input()
a = set()
for i in len(s):
  a.add(i)
if len(a) == 2:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

s = input()
a = set()
for i in range(len(s)):
  a.add(s[i])
if len(a) == 2:
  print('Yes')
else:
  print('No')
n = int(input())
wordlist = [input() for i in range(n)]
wordtuple = tuple(set(wordlist))
ans = []
a = len(wordtuple)
for j in range(a) :
    checklist.append(wordlist.count(wordtuple[j]))
anslist = [i for i, v in enumerate(checklist) if v == max(checklist)]
for k in anslist :
    ans.append(wordtuple[k])
ans.sort()
for l in range(len(ans)) :
    print(ans[l])

### FIXED CODE ###

n = int(input())
d = {}
for i in range(n) :
    s = input()
    if s not in d :
        d[s] = 1
    else :
        d[s] += 1
m = max(d.values())
ans = []
for i in d :
    if d[i] == m :
        ans.append(i)
ans.sort()
for i in ans:
    print(i)
import sys
input = sys.stdin.buffer.readline
N, K = map(int, input().split())
A = list(map(lambda x: int(x)-1, input().split()))
now = 0
dict_ = {}
stack = []
for i in range(N):
    if now not in dict_:
        dict_[now] = A[now]
        stack.append(now)
        now = A[now]
    else:
        idx = stack.index(now)
        mod = i+1 - idx
        break
idx = idx + (K-idx) % mod
idx = min(K, idx)
print(stack[idx]+1)


### FIXED CODE ###

def main():
    import sys
    input = sys.stdin.buffer.readline
    N, K = map(int, input().split())
    A = list(map(lambda x: int(x)-1, input().split()))
    now = 0
    dict_ = {}
    stack = []
    for i in range(N):
        if now not in dict_:
            dict_[now] = A[now]
            stack.append(now)
            now = A[now]
        else:
            idx = stack.index(now)
            mod = i - idx
            break
    idx = idx + (K-idx) % mod
    idx = min(K, idx)
    print(stack[idx]+1)


if __name__ == '__main__':
    main()
x = int(input())
print(x//3600+":"+(x//60)%60+":"+(x%60))


### FIXED CODE ###

x = int(input())
print(x//3600,end="")
print(':',end="")
print((x//60)%60,end="")
print(':',end="")
print(x%60)
x,y = map(int,input().split())
if y == x:
    print(0)
else:
    if abs(y) >= abs(x):
        tmp = abs(y)-abs(x)
        if x>=0 and y>=0:
            print(tmp)
        elif x>=0 and y<0:
            print(tmp+1)
        elif x<0 and y>=0:
            #print(tmp+1)
            print(1/0)
        else:
            print(abs(y)-x+1)
    else:
        if x>=0 and y>=0:
            print(x+y+1)
        elif x>=0 and y<0:
            print(x+y+1)
        elif x<0 and y>=0:
            print(y-x)
        else:
            print(y-x)

### FIXED CODE ###

x,y = map(int,input().split())
if y == x:
    print(0)
elif y == 0:
    if x > 0:
        print(x+1)
    else:
        print(-x)
else:
    if abs(y) >= abs(x):
        tmp = abs(y)-abs(x)
        if x>=0 and y>=0:
            print(tmp)
        elif x>=0 and y<0:
            print(tmp+1)
        elif x<0 and y>=0:
            print(tmp+1)
        else:
            print(tmp+2)
    else:
        if x>=0 and y>=0:
            print(-y+x+2)
        elif x>=0 and y<0:
            print(x+y+1)
        elif x<0 and y>=0:
            print(-y-x+1)
        else:
            print(y-x)
import sys

class UnionFind:
    def __init__(self, size):
        self.parent = [-1 for i in range(size)]#非負なら親ノード，負ならグループの要素数

    def root(self, x): #root(x): xの根ノードを返す．
        if self.parent[x] < 0:
            return x
        else:
            self.parent[x] = self.root(self.parent[x]) #xをxの根に直接つなぐ
            return self.parent[x]

    def merge(self, x, y): #merge(x,y): xのいるグループと$y$のいるグループをまとめる
        x = self.root(x)
        y = self.root(y)
        if x == y:
            return False
        if self.parent[x] > self.parent[y]: #xの要素数がyの要素数より「小さい」とき入れ替える
            x,y=y,x
        self.parent[x] += self.parent[y] #xの要素数を更新
        self.parent[y] = x #yをxにつなぐ
        return True

    def issame(self, x, y): #same(x,y): xとyが同じグループにあるならTrue
        return self.root(x) == self.root(y)
        
    def size(self,x): #size(x): xのいるグループの要素数を返す
        return -self.parent[self.root(x)]


n, m = map(int, input().split())
bridges = list(sys.stdin)
bridges.reverse()
buf = [n * (n - 1) // 2]
uft = UnionFind(n)
for line in bridges[:-1]:
    a, b = map(int, line.split())
    a -= 1
    b -= 1
    if uft.find(a, b):
        buf.append(buf[-1])
        continue
    ra = uft.table[uft._root(a)]
    rb = uft.table[uft._root(b)]
    buf.append(buf[-1] - ra * rb)
    uft.union(a, b)
buf.reverse()
print('\n'.join(map(str, buf)))
    
    
    
    
    





### FIXED CODE ###

class UnionFind:
    def __init__(self, size):
        self.parent = [-1 for i in range(size)]#非負なら親ノード，負ならグループの要素数

    def root(self, x): #root(x): xの根ノードを返す．
        if self.parent[x] < 0:
            return x
        else:
            self.parent[x] = self.root(self.parent[x]) #xをxの根に直接つなぐ
            return self.parent[x]

    def merge(self, x, y): #merge(x,y): xのいるグループと$y$のいるグループをまとめる
        x = self.root(x)
        y = self.root(y)
        if x == y:
            return False
        if self.parent[x] > self.parent[y]: #xの要素数がyの要素数より「小さい」とき入れ替える
            x,y=y,x
        self.parent[x] += self.parent[y] #xの要素数を更新
        self.parent[y] = x #yをxにつなぐ
        return True

    def issame(self, x, y): #same(x,y): xとyが同じグループにあるならTrue
        return self.root(x) == self.root(y)
        
    def size(self,x): #size(x): xのいるグループの要素数を返す
        return -self.parent[self.root(x)]


n,m=[int(i) for i in input().split()]

A=[[int(i)-1 for i in input().split()] for _ in range(m)]

ans = [0]*(m+1)
a = n*(n-1)//2
ans[0] = a

uf = UnionFind(n)
for i in range(m):
    j = m-i-1
    v1 = A[j][0]
    v2 = A[j][1]
#    print(v1,v2)
    if not uf.issame(v1,v2):
#        print(uf.parent)
        a -= uf.size(v1) * uf.size(v2)
        uf.merge(v1,v2)

    ans[i+1]=a

for i in range(m):
    print(ans[m-i-1])
n,m=map(int,input().split())
r={}
for _ in range(m):
  a,b=map(int,input().split())
  a,b=a-1,b-1
  if a not in r: r[a]=[]
  r[a].append(b)
  if b not in r: r[b]=[]
  r[b].append(a)

ans = {0:0}
steps = [-1]*n
steps[0]=0
def setroot(i,step):
  newroom = [v for v in r[i] if steps[v]<0 or steps[v]>step]
  #print(i,newroom)
  if len(newroom)>0:
    for v in newroom:ans[v]=i;steps[v]=step
    for v in newroom:setroot(v,step+1)
setroot(0,0)
#print(r)
#print(steps)
if len(ans) == n:
  print('Yes')
  for i in range(1,n):
    print(ans[i]+1)
else:
  print('No')

### FIXED CODE ###

f=lambda:map(int,input().split())
n,m=f()
g=[[] for _ in range(n)]
for _ in range(m):
  a,b=f()
  g[a-1]+=[b-1]
  g[b-1]+=[a-1]
p=[0]*n
from collections import*
q=deque([0])
while q:
  v=q.popleft()
  for c in g[v]:
    if p[c]<1: p[c]=v+1; q.append(c)
if 0 in p: print('No')
else: print('Yes',*p[1:],sep='\n')
A, B = map(int, input().split())

def main1(A, B):
    res = 0
    if B + 1 < A:
        res = (A * 2) - 1
    elif A == B :
        res = A + B
    else:
        res = (B * 2) - 1
    print(res)

main(A, B)


### FIXED CODE ###

def main1(A, B):
    res = 0
    if A == B:
        res = A * 2
    else:
        res = (max(A,B) * 2) - 1
    print(res)

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

#main1(5,3)#9
#main1(3,4)#7
#main1(6,6)#12
import math
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
l = [a, b, c, d, e]
ans = 9
n = 9
j = 0
for i in [i % 10 for i in l]:
    if i != 0 and i < ans:
        ans = i
        n = j
    j += 1
m = l.pop(n)
r = 0
for i in l:
    r += math.ceil(i / 10) * 10
print(r + m)


### FIXED CODE ###

import math
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
l = [a, b, c, d, e]
ans = 9
n = 0
j = 0
for i in [i % 10 for i in l]:
    if i != 0 and i < ans:
        ans = i
        n = j
    j += 1
m = l.pop(n)
r = 0
for i in l:
    r += math.ceil(i / 10) * 10
print(r + m)
a,b,c=map(int, input().split())
print((a-b-2*c)//(b+C)+1)

### FIXED CODE ###

a,b,c=map(int, input().split())
print((a-b-2*c)//(b+c)+1)
import math
import sys

n = int(input())

low = sys.maxsize
a, b = 0, 0
for i in range(math.floor(math.sqrt(n))):
    if n%i == 0 and (i + n//i) <= low:
        a, b = i, n//i
        low = a + b
print(a+b-2)

### FIXED CODE ###

n = int(input())

ans = n+1
for i in range(2, 10**6+1):
    if n%i == 0:
        ans = min(ans, i + n//i)
print(ans-2)
N,K=map(int,input().split())
list_A=list(map(int,input().split()))
list_F=list(map()int,input().split())
list_A_sort=list_A.sort()
list_F_sort=list_F.sort()
list_F_reverse=list_F_sort.reverse()

list_A1=[]
for x in list_A_sort:
  list_A1.append(x-1)
  

### FIXED CODE ###

import numpy as np

a,b=map(int,input().split())
A=np.array(sorted(list(map(int,input().split()))))
F=np.array(sorted(list(map(int,input().split())),reverse=True))

s=A.sum()

x=-1
y=10**12
while x+1<y:
  mid=(x+y)//2
  if s-np.minimum(A,mid//F).sum()<=b:
    y=mid
  else:
    x=mid
print(y)
N=int(input())
a=list(map(int,input().split()))
ans=0
for i in a:
    ans=max(ans,sa.count(i-1)+sa.count(i)+sa.count(i+1))
print(ans)

### FIXED CODE ###

import collections
N=int(input())
a=list(map(int,input().split()))

arr=[]
for i in a:
    arr.extend([i-1,i,i+1])

arr_c=collections.Counter(arr)

print(max(arr_c.values()))
a,b = map(int, raw_input().split());

print '%d %d' %(2*(a+b), a*b)

### FIXED CODE ###

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

print a*b, 2*(a+b)
n=int(input())
a=[0]
a.extend(list(map(int,input().split())))
a.append([0])
s=0
for i in range(n+1):
  s+=abs(a[i+1]-a[i])
for i in range(1,n+1):
  print(s-abs(a[i+1]-a[i])-abs(a[i]-a[i-1])+abs(a[i+1]-a[i-1]))

### FIXED CODE ###

n=int(input())
a=[0]
a.extend(list(map(int,input().split())))
a.append(0)
s=0
for i in range(n+1):
  s+=abs(a[i+1]-a[i])
for i in range(1,n+1):
  print(s-abs(a[i+1]-a[i])-abs(a[i]-a[i-1])+abs(a[i+1]-a[i-1]))
import sys
input = sys.stdin.readline

S = input().rstrip()
Q = int(input())
head = ''
tail = ''
rev = False

for _ in range(Q):
    query = list(input().split())
    for i in range(10**5):
        if query[0] == '1':
            if flag:
                rev = False
            else:
                rev = True
            continue
        elif query[0] == '2':
            f = query[1]
            c = query[2].rstrip()
            if f == '1':
                if rev:
                    tail = tail + c
                else:
                    head = c + head
            elif:
                if rev:
                    head = c + head
                else:
                    tail = tail + c
if flag:
    print(head + S + tail)
else:
    tmp = head + S + tail
    print(tmp[::-1])


### FIXED CODE ###

import sys
input = sys.stdin.readline

S = input().rstrip()
Q = int(input())
head = ''
tail = ''
rev = False

for _ in range(Q):
    query = list(input().split())
    if query[0] == '1':
        if rev:
            rev = False
        else:
            rev = True
    elif query[0] == '2':
        f = query[1]
        c = query[2].rstrip()
        if f == '1':
            if rev:
                tail = tail + c
            else:
                head = c + head
        else:
            if rev:
                head = c + head
            else:
                tail = tail + c
if rev:
    tmp = head + S + tail
    print(tmp[::-1])
else:
    print(head + S + tail)
#入力
#関数へ
#関数
    #
def a(t,i):
    if j = len(s)-1:
        return sum(map(int,t.split('+')))
    return a(t+s[i+1],i+1) + a(t+'+'+s[i+1],i+1) #関数の中に入れると最後の項でまとめて処理できる
s = input()
print(a(s[0],0))

### FIXED CODE ###

def dfs(i,s):
    if i==n-1:
        return sum(map(int,s.split('+')))
    return dfs(i+1,s+S[i+1])+dfs(i+1,s+'+'+S[i+1])

S=input()
n=len(S)
ans=dfs(0,S[0])
print(ans)
N,W=map(int,input().split())
weight=[0]*N
values=[0]*N
for i in range(N):
  weight[i],values[i]=map(int,input().split())

dp=[[0 for i in range(N+10)] for j in range(W+10)]

for i in range(N):
  for w in range(W+1):
    if w>=weight[i]:
      dp[i+1][w]=max(dp[i][w],dp[i][w-weight[i]]+values[i])
    else:
      dp[i+1][w]=dp[i][w]
      
print(dp[N][W])

### FIXED CODE ###

def calc():
  N,W=map(int,input().split())
  dp=[-1]*(W+1)
  dp[0]=0
  for i in range(N):
    w,v=map(int,input().split())
    for j in range(W-w,-1,-1):
      if dp[j]!=-1:
        if dp[j+w]<dp[j]+v:
          dp[j+w]=dp[j]+v
  print(max(dp))
  
calc()
x, y = map(int, input().split())
a = [1, 3, 5, 7, 8, 10, 12]
b = [4, 6, 9, 11]
c = [2]
if (x in a and y in a) or (x in b and y in b) or (x in c in y in c):
    print('Yes')
else:
    print('No')


### FIXED CODE ###

x, y = map(int, input().split())
a = [1, 3, 5, 7, 8, 10, 12]
b = [4, 6, 9, 11]
c = [2]
if (x in a and y in a) or (x in b and y in b) or (x in c and y in c):
    print('Yes')
else:
    print('No')
import string

N = int(input())
al = string.ascii_lowercase

if (N >= 1 and N <= 26):
    print(al[N - 1])
    exit()
elif (N >= 27 and N <= 702):
    n = N // 26
    amari = N % 26
    if (amari == 0 and n != 27):
        print(al[n - 1] + al[25])
        exit()
    elif (amari == 0 and n == 27):
        print(al[25] + al[25])
        exit()
    else:
        print(al[n - 1] + al[amari - 1])
elif (N >= 703):
    s = ''
    num = 26
    while N > 26:
        amari = N % num
        N //= 26
        if (amari == 0):
            N -= 1
        if (amari == 0):
            s += al[25]
        else:
            s += al[amari - 1]
if (N == 0):
    s += al[25]
else:
    s += al[N - 1]
print(s[::-1])


### FIXED CODE ###

import string

N = int(input())
al = string.ascii_lowercase

# if (N >= 1 and N <= 26):
#     print(al[N - 1])
#     exit()
# elif (N >= 27 and N <= 702):
#     n = N // 26
#     amari = N % 26
#     if (amari == 0 and n != 27):
#         print(al[n - 1] + al[25])
#         exit()
#     elif (amari == 0 and n == 27):
#         print(al[25] + al[25])
#         exit()
#     else:
#         print(al[n - 1] + al[amari - 1])
#         exit()
# elif (N >= 703):
s = ''
num = 26
while N > 26:
    amari = N % num
    N //= 26
    if (amari == 0):
        N -= 1
    if (amari == 0):
        s += al[25]
    else:
        s += al[amari - 1]
if (N == 0):
    s += al[25]
else:
    s += al[N - 1]
print(s[::-1])
x,n = list(map(int,input().split()))
p= list(map(int,input().split()))

for i in range(x+1):
 for s in [-1,+1]:
   a=X+s*d
   if a not in p:
     print(a)




### FIXED CODE ###

x,n = list(map(int,input().split()))
p= list(map(int,input().split()))
 
for i in range(x+1):
 for s in [-1,+1]:
   a=x+s*i
   if a not in p:
     print(a)
     exit(0)
s = input()
t_s = n.count("p")
a_s = len(s) // 2
print(a_s-t_s)

### FIXED CODE ###

s = input()
t_s = s.count("p")
a_s = len(s) // 2
print(a_s-t_s)
s = input()
n = len(s)
cost = 0
for i in range(n // 2):
    cost += (s[i] != s[n - i])
print(cost)

### FIXED CODE ###

s = input()
n = len(s)
cost = 0
for i in range(n // 2):
    cost += (s[i] != s[n - i - 1])
print(cost)
import sys
sys.setrecursionlimit(100000)

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

MOD = 10 ** 9 + 7

if m == 1:
    print('1')
    exit()

factor = []
temp = 0
x = 2
while m > 1:
    if m % x == 0:
        m //= x
        temp += 1
    elif temp > 0:
        factor.append(temp)
        temp = 0
        x += 1
    else:
        x += 1
factor.append(temp)

nCr = {}
def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n;
    if (n, r) in nCr: return nCr[(n, r)]

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p;
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    nCr[(n, r)] = result
    return result;

ans = 1
for x in factor:
    ans *= cmb(x + n - 1, n - 1)
    ans %= MOD

print(ans)

### FIXED CODE ###

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

a = sorted(a)

print(a[2] * 10 + sum(a[:2]))
w = input()
for i in range(len(w)):
    if w.count(w[i])%2 == 1:
        print("No")
        exit(1)

print("Yes")


### FIXED CODE ###

w = input()
only = list(set(w))
count = 0
can = True
for i in only:
    if w.count(i) % 2 != 0:
        can = False
        break
if can:
    print('Yes')
else:
    print('No')
a = [int(input()) for i in range(1,4) ]

if a[1]==a[2]:
     print(a[3])
elif a[1]==a[3]:
     print(a[2])
else:
     print(a[1])

### FIXED CODE ###

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

if a==b:
     print(c)
elif a==c:
     print(b)
else:
     print(a)
inport math
n = int(input())
print(math.ceil(n/2)/n)

### FIXED CODE ###

import math
n = int(input())
print(math.ceil(n/2)/n)
import numpy as np

N = str(input())
array = np.array(list(map(int, s)))

s = np.sum(array)
if s % 9 == 0:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

import numpy as np

N = str(input())
array = np.array(list(map(int, N)))

s = np.sum(array)
if s % 9 == 0:
  print('Yes')
else:
  print('No')
from collections import deque
import heapq

N = int(input())
A = list(map(int, input().split()))
B = A.copy()
heapq.heapify(B)
ans = deque()

for i in range(N - 1):
    ans.append(A.index(heapq.heappop(B)) + 1)

print(" ".join(map(str, list(ans) + [A.index(B[0]) + 1])))

### FIXED CODE ###

from collections import deque

N = int(input())
A = list(map(int, input().split()))
A = list(enumerate(A))
A.sort(key = lambda x: x[1])

ans = deque()

for a in A:
    ans.append(a[0] + 1)

print(" ".join(map(str, ans)))
N = int(input())
S = list(map(int,input().split()))
p = S.count("P")
w = S.count("W")
g = S.count("G")
y = S>count("Y")
ans = p+w+g+y
if ans == 3 :
    print("Three")
else :
    print("Four")
    

### FIXED CODE ###

N = int(input())
L = list(map(str,input().split()))
flag = 4
if "P" in L :
    flag -= 1
if "W" in L :
    flag -= 1
if "G" in L :
    flag -= 1
if "Y" in L :
    flag -= 1
if flag == 0 :
    print("Four")
else :
    print("Three")
# ダイナミック・プログラミング(DP)

H, N = map(int, input().split())
magic_list = []

for i in range(N):
    A, B = map(int, input().split())
    magic_list.append([A, B])


dp_memo = {} # メモ化再帰
def dp_magic_2(HP):
    mp_list = []
    if HP<=0:
        return 0
    elif HP in dp_memo:
        return dp_memo[HP]
    else:
        for m in magic_list:
            mp_list.append(dp_magic_2(HP-m[0]) + m[1])
        result_mp = min(mp_list)
        dp_memo[HP] = result_mp
        return result_mp

print(dp_magic_2(H))


### FIXED CODE ###

# ダイナミック・プログラミング
# PythonではTLEを起こしてしまう例

INF = float('inf')

H, N = map(int, input().split())
A = []
B = []

for i in range(N):
    a_i, b_i = map(int, input().split())
    A.append(a_i)
    B.append(b_i)

dp = [[INF]*(H+1) for i in range(N+1)] # DP用配列
dp[0][0] = 0 # 初期化処理
for i in range(0,N):
    for j in range(0,H+1):
        a, b = j+A[i], H
        min_h = a
        if a>b:
            min_h = b
        a, b = dp[i+1][j], dp[i][j]
        if a>b:
            dp[i+1][j] = b
        a, b = dp[i+1][min_h], dp[i+1][j]+B[i]
        if a>b:
            dp[i+1][min_h] = b

print(dp[N][H])
s = str(input())

ans = 0
for i in range(len(s)-1):
  if s[i:i+2] == 'BC':
    cnt = 0
    for j in range(i):
      if s[i-1-j] == 'A':
        cnt += 1
      else:
        break
    s = s[:i-j-cnt] + 'BC' + 'A'*cnt + s[i+2:]
    ans += cnt
print(ans)

### FIXED CODE ###

s = str(input())

ans, cnt, i = 0, 0, 0
while i < len(s)-1:
  if s[i] == 'A':
    cnt += 1
    i += 1
  else:
    if s[i:i+2] == 'BC':
      ans += cnt
      i += 2
    else:
      cnt = 0
      i += 1
print(ans)
S = input()
for i in len(S):
  c = S[i]
  s = i if c =='A'
  if c =='Z':
    print(S[s:i+1])
    break

### FIXED CODE ###

S = input()
L = len(S)
for i in range(L):
  c = S[i]
  if c == "A":
    s = i
    break
for i in range(L):
  c = S[-(i+1)]
  if c == "Z":
    e = L - (i+1)
    break
print(e-s+1)
a=[]
ra=[]
for i in range(5):
  a.append(int(input()))

for i in range(5):
  ra.append(a[i]%10)

rmin=10
mi=10
for i in range(5):
  if ra[i]!=0 and ra[i]<rmin:
    rmin=ra[i]
    mi=i
    
mintime=0
for i in range(5):
  if ra[i]==0:
    mintime+=a[i]
  else:
    mintime+=a[i]+10-ra[i]
mintime-=10-ra[mi]
print(mintime)

### FIXED CODE ###

a=[]
ra=[]
for i in range(5):
  a.append(int(input()))

for i in range(5):
  ra.append(a[i]%10)

tot=0
for i in range(5):
  if ra[i]==0:
    tot+=a[i]

  else:
    tot+=a[i]+10-ra[i]
    

ra.sort()
for i in range(5):
  if ra[i]==0:
    continue
  else:
    tot-=10-ra[i]
    break
print(tot)
N = int(input())
x =[]
y =[]
h =[]
for i in range(N):
    x1, y1, h1 = [int(i) for i in input().split()]
    x.append(x1)
    y.append(y1)
    h.append(h1)

for i in range(101):
    for j in range(101):
        flag = True
        for k in range(N):
            
            if k == 0 and h[i] != 0:
                temp = max(abs(x[k]-i) + abs(y[k]-j) + h[k], 0)

            if temp != max(abs(x[k]-i) + abs(y[k]-j) + h[k], 0) and h[i] != 0 :
                flag = False

        if flag == True:
            print(i, j, temp)



### FIXED CODE ###

N = int(input())
p = []
for i in range(N):
    X1, Y1, H1 = map(int, input().split())
    if H1 != 0:
        p.append([X1, Y1, H1])

if len(p) == 1:
    print(p[0][0], p[0][1], p[0][2])
    exit()


for i in range(101):
    for j in range(101):
        h = -1
        fg = True
        for t in p:
            if h == -1:
                h = t[2] + abs(i - t[0]) + abs(j - t[1])

            else:
                ht = t[2] + abs(i - t[0]) + abs(j - t[1])
                if h == ht:
                    h = ht
                else:
                    fg = False
                    break
        if fg:
            print(i, j, h)
n =int(input())
a =list(map(int, input().split()))

a_min = min(a)
a_max = max(a)

x = a_max - a_min

for i in range(x):
    z = i + a_min
    hp = 0
    for x in a:
        hp += (x - z) ** 2
    if i == 0:
        ans = hp
    if ans > hp:
        ans = hp

print(ans)

### FIXED CODE ###

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

a_min = min(a)


for i in range(100):
    z = i + a_min
    hp = 0
    for x in a:
        hp += (x - z) ** 2
    if i == 0:
        ans = hp
    if ans > hp:
        ans = hp

print(ans)
a = input()
b = input()

a = int(a)
b = int(b)

print(a*b, " ", (2*a)+(2*b))



### FIXED CODE ###

a, b = (int(x) for x in input().split())

print(a*b, (2*a)+(2*b))
count = 0
N = int(input())
S = input()

for i in range(N):
    if S[i] == "A" and S[i+1] == "B" and S[i+2] == "C":
        count += 1

print(count)

### FIXED CODE ###

count = 0
N = int(input())
S = input()

for i in range(N-2):
    if S[i] == "A" and S[i+1] == "B" and S[i+2] == "C":
        count += 1

print(count)