Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
A, B = map(int, input().split())

print(max([A+B, A-B, A*B])

Fixed submission:
A, B = map(int, input().split())

print(max([A+B, A-B, A*B]))

Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())

print(max([A+B, A-B, A*B]))

Fixed submission:
A, B = map(int, input().split())

print(max([A+B, A-B, A*B]))

Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())

result = A + B
if A - B > result:
  result = A - B
if A * B > result:
  result = A * B
print(result)

Fixed submission:
A, B = map(int, input().split())

print(max([A+B, A-B, A*B]))
Buggy python submission (verdict: Runtime Error):
A, B, C = map(int, input().split())

print(s = C-(A-B) if C-(A-B) > 0 else 0)

Fixed submission:
A, B, C = map(int, input().split())

s = C-(A-B)
print(s if C-(A-B) > 0 else 0)

Buggy python submission (verdict: Runtime Error):
A, B, C = map(int, input().split())

print(s if C-(A-B) > 0 else 0)

Fixed submission:
A, B, C = map(int, input().split())

s = C-(A-B)
print(s if C-(A-B) > 0 else 0)
Buggy python submission (verdict: Runtime Error):
A, B = map(int, input())

if A%2 != B%2:
  print("IMPOSSIBLE")
else:
  print((A+B)/2)

Fixed submission:
A, B = map(int, input().split())

if A%2 != B%2:
  print("IMPOSSIBLE")
else:
  print(int((A+B)/2))

Buggy python submission (verdict: Runtime Error):
A, B = map(int, input())

if A%2 != B%2:
  print("IMPOSSIBLE")
else
  print((A+B)/2)

Fixed submission:
A, B = map(int, input().split())

if A%2 != B%2:
  print("IMPOSSIBLE")
else:
  print(int((A+B)/2))

Buggy python submission (verdict: Runtime Error):
A, B = map(int, input())

if A%2 != B%2:
  print("IMPOSSIBLE")
else
  print((A+B)/2)

Fixed submission:
A, B = map(int, input().split())

if A%2 != B%2:
  print("IMPOSSIBLE")
else:
  print(int((A+B)/2))

Buggy python submission (verdict: Runtime Error):
A, B = map(int, input())

if A%2 != B%2:
  print("IMPOSSIBLE")
else
  print(abs((A+B)/2))

Fixed submission:
A, B = map(int, input().split())

if A%2 != B%2:
  print("IMPOSSIBLE")
else:
  print(int((A+B)/2))
Buggy python submission (verdict: Runtime Error):
S = list(int(input()))

if S[0] == S[1] or S[1] == S[2] or S[2] == S[3]:
  print("Bad")
else:
  print("Good")


Fixed submission:
S = list(input())
if S[0] == S[1] or S[1] == S[2] or S[2] == S[3]:
  print("Bad")
else:
  print("Good")
Buggy python submission (verdict: Runtime Error):
P, Q, R = map(int, input().split())

list = [P, Q, R]
min1 = min(list)
list.pop(min1)
min2 = min(list)
print(min1 + min2)

Fixed submission:
P, Q, R = map(int, input().split())

list = [P, Q, R]
min1 = min(list)
list.remove(min1)
min2 = min(list)
print(min1 + min2)
Buggy python submission (verdict: Runtime Error):
r = input()
print(int(r*r))

Fixed submission:
r = int(input())
s = r*r
print(int(s))
Buggy python submission (verdict: Runtime Error):
a,b = map(int, input().split())
p = a*b
if p%2 ==　0:
  print("Even")
else:
  print("Odd")

Fixed submission:
a,b = map(int, input().split())
p = a*b
if p%2 == 0:
  print("Even")
else:
  print("Odd")
Buggy python submission (verdict: Runtime Error):
N = int(input())
num = list(map(int, input().split()))
counter = [0] * N
for j in range(N):
  while num[i]%2==0:
    num[i] = num[i]/2
    counter[i] += 1
print(min(counter))

Fixed submission:
N = int(input())
num = list(map(int, input().split()))
counter = [0] * N
for i in range(N):
  while num[i]%2==0:
    num[i] = num[i]/2
    counter[i] += 1
print(min(counter))
Buggy python submission (verdict: Runtime Error):
import numpy as np
import math

H, N = map(int, input().split())
mahou = np.array([list(map(int, input().split())) for _ in range(N)])

dmg = mahou[:, 0]
mp = mahou[:, 1]

dp = np.full(H+1, float("inf"))
dp[0] = 0

for h in range(H):
  for d, m in zip(dmg, mp):
    new_hp = min(h + d, H)
    dp[new_hp] = min(dp[new_hp], dp[h] + m)
print(int(dp[-1]))


Fixed submission:
#import numpy as np
import math

H, N = map(int, input().split())
#mahou = np.array([list(map(int, input().split())) for _ in range(N)])
mahou = [list(map(int, input().split())) for _ in range(N)]


dp = [float("inf")]*(H+1)
dp[0] = 0

for h in range(H):
  for d, m in mahou:
    new_hp = min(h + d, H)
    dp[new_hp] = min(dp[new_hp], dp[h] + m)
print(int(dp[-1]))

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
import math

H, N = map(int, input().split())
mahou = np.array([list(map(int, input().split())) for _ in range(N)])

dmg = mahou[:, 0]
mp = mahou[:, 1]

dp = np.full(H+1, float("inf"))
dp[0] = 0

for h in range(H):
  for d, m in zip(dmg, mp):
    new_hp = min(h + d, H)
    dp[new_hp] = min(dp[new_hp], dp[h] + m)
print(int(dp[-1]))


Fixed submission:
#import numpy as np
import math

H, N = map(int, input().split())
#mahou = np.array([list(map(int, input().split())) for _ in range(N)])
mahou = [list(map(int, input().split())) for _ in range(N)]


dp = [float("inf")]*(H+1)
dp[0] = 0

for h in range(H):
  for d, m in mahou:
    new_hp = min(h + d, H)
    dp[new_hp] = min(dp[new_hp], dp[h] + m)
print(int(dp[-1]))
Buggy python submission (verdict: Runtime Error):
#coding:utf-8

import sys

N = int(input())
S = input()

T = len(S)

for t in reversed(range(T+1)):
    i = 0
    while 0 < len(S[i:i+t-1]) and len(S[i:i+t-1]) <= len(S[i+t-1:]):
        if S[i:i+t-1] in S[i+t-1:]:
            print(len(S[i:i+t-1]))
            sys.exit()
        i += 1
print('0')


Fixed submission:
#coding:utf-8

S = input()

if S == 'Sunny':
    print('Cloudy')
elif S == 'Cloudy':
    print('Rainy')
else:
    print('Sunny')

Buggy python submission (verdict: Runtime Error):
#coding:utf-8

S = input()

if S == 'Sunny':
    print('Cloudy')
elif S == 'Cloudy':
    print(Rainy)
else:
    print('Sunny')


Fixed submission:
#coding:utf-8

S = input()

if S == 'Sunny':
    print('Cloudy')
elif S == 'Cloudy':
    print('Rainy')
else:
    print('Sunny')
Buggy python submission (verdict: Runtime Error):
#coding:utf-8

S = input()

if ('L' in set(S[0::2]) or ('R' in set(S[1::2]):
    print('No')
else:
    print('Yes')


Fixed submission:
#coding:utf-8

S = input()

if ('L' in set(S[0::2])) or ('R' in set(S[1::2])):
    print('No')
else:
    print('Yes')
Buggy python submission (verdict: Time Limit Exceeded):
#coding:utf-8

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

for m in range(M):
    A[A.index(max(A))] = max(A)/2
total = sum(map(int, A))

print(total)


Fixed submission:
#coding:utf-8

import heapq

N, M = map(int, input().split())
invA = []
for a in map(int, input().split()):
    heapq.heappush(invA, -1*a)
for m in range(M):
    heapq.heappush(invA, heapq.heappop(invA)/2)
total = -1*sum(map(int, invA))

print(total)
Buggy python submission (verdict: Runtime Error):
import sys
H = sys.stdin.readline()
H = int(H)

count = 0
roop_c = 2
while True:
    H = H // 2
    count += roop_c
    roop_c *= 2

    if H == 1:
        break

print(count+1)


Fixed submission:
import sys
inputs = sys.stdin.readline()
inputs = inputs.split()
# inputs = inputs.split('')

H, A = int(inputs[0]), int(inputs[1])

count = 0
while H>0:
    H =  H - A
    count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
import sys
# s = sys.stdin.readlines()
inputs = sys.stdin.readline()
A = sys.stdin.readline()
inputs = inputs.split()
H, N = inputs[0], inputs[1]
A = A.split()

A_sum = 0
for i in range(len(A)):
    A_sum += A[i]

if A_sum < H:
    print('No')
else:
    print('Yes')

Fixed submission:
import sys
# s = sys.stdin.readlines()
inputs = sys.stdin.readline()
A = sys.stdin.readline()
inputs = inputs.split()
H, N = int(inputs[0]), int(inputs[1])
A = A.split()

A_sum = 0
for i in range(len(A)):
    A_sum += int(A[i])

if A_sum < H:
    print('No')
else:
    print('Yes')
Buggy python submission (verdict: Runtime Error):
h, a = input()

h = int(h)
a = int(a)

cnt = 0

while (h > 0):
	h -= a
	cnt += 1

print(cnt)

Fixed submission:
h, a = map(int, input().split())

cnt = 0

while (h > 0):
	h -= a
	cnt += 1

print(cnt)

Buggy python submission (verdict: Runtime Error):
h, a = int(input())
cnt = 0

while (h > 0):
	h -= a
	cnt += 1

print(cnt)

Fixed submission:
h, a = map(int, input().split())

cnt = 0

while (h > 0):
	h -= a
	cnt += 1

print(cnt)

Buggy python submission (verdict: Runtime Error):
h = int(input())
a = int(input())
cnt = 0

while (h > 0):
	h -= a
	cnt += 1

print('{}'.format(cnt))

Fixed submission:
h, a = map(int, input().split())

cnt = 0

while (h > 0):
	h -= a
	cnt += 1

print(cnt)

Buggy python submission (verdict: Runtime Error):
h = int(input())
a = int(input())
cnt = 0

while (h > 0):
	h -= a
	cnt += 1

print(cnt)

Fixed submission:
h, a = map(int, input().split())

cnt = 0

while (h > 0):
	h -= a
	cnt += 1

print(cnt)

Buggy python submission (verdict: Runtime Error):
h = int(input())
a = int(input())
cnt = 0

while (h > 0):
	h -= a
	cnt += 1

print(cnt)

Fixed submission:
h, a = map(int, input().split())

cnt = 0

while (h > 0):
	h -= a
	cnt += 1

print(cnt)

Buggy python submission (verdict: Runtime Error):
import math

line = input()
numList = [int(num) for num in line.split(' ')]
monsterHP,servalA = numList[0].numList[1]
print(math.ceil(monsterHP/servalA))


Fixed submission:
import math
 
line = input()
numList = [int(num) for num in line.split(' ')]
monsterHP,servalA = numList[0],numList[1]
print(math.ceil(monsterHP/servalA))
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())

if n==m :
  print(Yes)
else :
  print(No)

Fixed submission:
n,m=map(int,input().split())

if n==m :
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
r=input()
x=r*r
print(x)

Fixed submission:
r=int(input())

x=r*r

print(x)
Buggy python submission (verdict: Runtime Error):
a,b=int(input())

x=a+b
y=a-b
z=a*b

print(max(x,y,z))

Fixed submission:
a,b=map(int,input().split())

x=a+b
y=a-b
z=a*b

print(max(x,y,z))

Buggy python submission (verdict: Runtime Error):
a,b=input()

x=a+b
y=a-b
z=a*b

print(max(x,y,z))


Fixed submission:
a,b=map(int,input().split())

x=a+b
y=a-b
z=a*b

print(max(x,y,z))
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
n, m = map(int, input().split())

lst1 = [i for i in range(1, n + 1)]

for i in range(m):
  l, r = map(int, input().split())
  lst = [l + j for j in range(r - l + 1)]
  lst1 = lst if len(lst1) == 0 else list(set(lst1) & set(lst))

print(len(lst1))


Fixed submission:
# -*- coding: utf-8 -*-
n, m = map(int, input().split())
max_value, min_value = -1, -1
for i in range(m):
  tmp_min_value, tmp_max_value = map(int, input().split())
  min_value = max([min_value, tmp_min_value]) if min_value >= 0 else tmp_min_value
  max_value = min([max_value, tmp_max_value]) if max_value >= 0 else tmp_max_value

min_value = min_value if min_value <= n else n
max_value = max_value if max_value <= n else n

ret = max_value - min_value + 1
if ret < 0:
  ret = 0
print(ret)
Buggy python submission (verdict: Runtime Error):
hp, _ = map(int, input().split(" "))
s = sum(map(int, input().split(" ")))
print((hp - s) <= 0)


Fixed submission:
H, A = map(int, input().split(" "))
print(H//A + (1 if H%A != 0 else 0))
Buggy python submission (verdict: Runtime Error):
hp, _ = map(int, input().split(" "))
s = sum(map(int, input().split(" ")))
return (hp - s) <= 0

Fixed submission:
hp, _ = map(int, input().split(" "))
s = sum(map(int, input().split(" ")))
print("Yes" if (hp - s) <= 0 else "No")
Buggy python submission (verdict: Runtime Error):
import sys
import math

args = sys.argv

hp = int(args[1])
attack = int(args[2])

if(hp <= attack):
    ans = "1"
else:
    ans = str(math.ceil(hp / attack))

print(int(ans))

Fixed submission:
import math

hp , attack = map(int,input().split())

if(hp <= attack):
    ans = "1"
else:
    ans = str(math.ceil(hp / attack))

print(int(ans))

Buggy python submission (verdict: Runtime Error):
import sys
import math

args = sys.argv

hp = int(args[1])
attack = int(args[2])

if(hp <= attack):
    ans = "1"
else:
    ans = str(math.ceil(hp / attack))

print(ans)

Fixed submission:
import math

hp , attack = map(int,input().split())

if(hp <= attack):
    ans = "1"
else:
    ans = str(math.ceil(hp / attack))

print(int(ans))

Buggy python submission (verdict: Runtime Error):
import sys

args = sys.argv

hp = int(args[1])
attack = int(args[2])

if(hp <= attack):
    ans = "1"
else:
    ans = str(hp // attack)

print(ans)

Fixed submission:
import math

hp , attack = map(int,input().split())

if(hp <= attack):
    ans = "1"
else:
    ans = str(math.ceil(hp / attack))

print(int(ans))

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

import sys
import math

args = sys.argv

hp = int(args[1])
attack = int(args[2])

if(hp <= attack):
    ans = "1"
else:
    ans = str(math.floor(hp / attack))

print(str(ans))

Fixed submission:
import math

hp , attack = map(int,input().split())

if(hp <= attack):
    ans = "1"
else:
    ans = str(math.ceil(hp / attack))

print(int(ans))

Buggy python submission (verdict: Runtime Error):
import sys
import math

args = sys.argv

hp = int(args[1])
attack = int(args[2])

if(hp <= attack):
    ans = "1"
else:
    ans = str(math.floor(hp / attack))

print(str(ans))

Fixed submission:
import math

hp , attack = map(int,input().split())

if(hp <= attack):
    ans = "1"
else:
    ans = str(math.ceil(hp / attack))

print(int(ans))

Buggy python submission (verdict: Runtime Error):
import sys

args = sys.argv
if(args[0] <= args[1]):
    ans = "1"
else:
    ans = int(args[1]) / int(args[0])

print(str(ans))

Fixed submission:
import math

hp , attack = map(int,input().split())

if(hp <= attack):
    ans = "1"
else:
    ans = str(math.ceil(hp / attack))

print(int(ans))
Buggy python submission (verdict: Runtime Error):
h = input()

def myfunc(hp):
    if(hp == 1):
        return 1
    elif(hp > 1):
        return int(myfunc(hp/2)) + int(myfunc(hp/2)) + 1


if __name__ == '__main__':
    ans = myfunc(int(h))
    print(ans)


Fixed submission:
h = input()

def myfunc(hp: 'int') -> 'int':
    if(hp == 1):
        return 1
    elif(hp > 1):
        return int(myfunc(hp/2)) * 2 + 1
    return hp


if __name__ == '__main__':
    ans = myfunc(int(h))
    print(ans)

Buggy python submission (verdict: Runtime Error):
h = map(int, input().split())
monster = list(h)

attack_count = 0
fin_flag = 0

print(monster)

while(fin_flag == 0):

    for i in range(len(monster)) :
        attack_count = attack_count + 1
        if(monster[i] == 1):
            if(i == 0 and monster[0] == 1):
                fin_flag = 1
                break
            monster.pop(i)
        else:
            monster.append(monster[i]//2)
            monster.append(monster[i]//2)
            monster.pop(i)

print(attack_count+1)

Fixed submission:
h = input()

def myfunc(hp: 'int') -> 'int':
    if(hp == 1):
        return 1
    elif(hp > 1):
        return int(myfunc(hp/2)) * 2 + 1
    return hp


if __name__ == '__main__':
    ans = myfunc(int(h))
    print(ans)
Buggy python submission (verdict: Runtime Error):
import numpy as np
n, m = [int(i) for i in input().split()]
a =[]
d = 1000000007

for i in range(m):
    a1=int(input())
    a.append(a1)

a.append(n+1)
a = np.array(a)
#print(a)

if 1 in a[1:]-a[:-1]:
    print(0)
    
elif m == 0:
    dp = [0] * (n + 1)
    dp[1] = 1
    dp[2] = 1
    for i in range(3, len(dp)):
        dp[i] = dp[i - 1] + dp[i - 2]
    print(dp[m])
    

else:
    dp = [0]*(n+1)
    dp[1]=1
    dp[2]=1
    for i in range(3,len(dp)):
        dp[i]=dp[i-1]+dp[i-2]
        #dp[i]=dp[i]%d

    ans = []
    pre = 0
    for i in range(len(a)):
        if i == 0:
            ans.append(a[i]-pre)
        else:
            ans.append(a[i]-pre-1)
        pre = a[i]

    #print(ans)
    x = 1
    for i in ans:
        x = x*dp[i]%d
    print(x)

Fixed submission:
p, q, r= [int(i) for i in input().split()]

l=[p,q,r]
print(sum(l)-max(l))
Buggy python submission (verdict: Time Limit Exceeded):
import re
s = input()
ans = 0

s = s.replace("BC","D")
t = re.split("[BC]",s)
t = [x for x in t if x]
#print(s)
#print(t)

for e in t:
    ind=[i for i, x in enumerate(e) if x == 'A']
    #print(ind)
    for j in ind:
        srt = e[j+1:]
        ans+=srt.count("D")

print(ans)


Fixed submission:
s = input()
s = s.replace("BC", "D")
#print(s)

ans = 0
cnt_a = 0
for i in range(len(s)):
    if s[i] in ["B", "C"]:
        cnt_a = 0
    elif s[i] == "A":
        cnt_a += 1
    elif s[i] == "D":
        ans += cnt_a

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
s = input()

ans = 0
while s.count('ABC')>0:
    ans += s.count('ABC')
    s=s.replace('ABC','BCA')

print(ans)


Fixed submission:
s = input()
s = s.replace("BC", "D")
#print(s)

ans = 0
cnt_a = 0
for i in range(len(s)):
    if s[i] in ["B", "C"]:
        cnt_a = 0
    elif s[i] == "A":
        cnt_a += 1
    elif s[i] == "D":
        ans += cnt_a

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n, k = [int(i) for i in input().split()]
s = input()

l = []
if s[0] == "0":
    l.append(0)
one = []
cnt_0 = 0
cnt_1 = 0

for i in s:
    if i == '0':
        if cnt_1 != 0:
            l.append(cnt_1)
            one.append((cnt_1))
            cnt_1 = 0
        cnt_0 += 1
    if i =='1':
        if cnt_0 != 0:
            l.append(cnt_0)
            cnt_0 = 0
        cnt_1 += 1

if cnt_1 != 0:
    l.append(cnt_1)
    one.append(cnt_1)
if cnt_0 != 0:
    l.append(cnt_0)
    l.append(0)

#print(one)
#print(l)


ans = 0

for i in range(0,len(l),2):
    #print(sum(l[i:+i+k*2+1]))
    if ans < sum(l[i:i+k*2+1]):
        ans = sum(l[i:i+k*2+1])

"""
if len(one) == 0:
    print(sum(l))

elif len(one) == 1:
    for i in range(len(l)):
        if ans < sum(l[i:i+2]):
            ans = sum(l[i:i+2])

if len(one) >= 2:
    for i in range(len(l)):
        if ans < sum(l[i:(k*2+1)+1]):
            ans = sum(l[i:(k*2+1)+1])
"""

print(ans)


Fixed submission:
n, k = [int(i) for i in input().split()]
s = input()

l = []
if s[0] == "0":
    l.append(0)
one = []
cnt_0 = 0
cnt_1 = 0

for i in s:
    if i == '0':
        if cnt_1 != 0:
            l.append(cnt_1)
            one.append((cnt_1))
            cnt_1 = 0
        cnt_0 += 1
    if i =='1':
        if cnt_0 != 0:
            l.append(cnt_0)
            cnt_0 = 0
        cnt_1 += 1

if cnt_1 != 0:
    l.append(cnt_1)
    one.append(cnt_1)
if cnt_0 != 0:
    l.append(cnt_0)
    l.append(0)

#print(l)
ans = 0
Sum = [0]
for i in range(len(l)):
    Sum.append(l[i]+Sum[i])
#print(Sum)

for i in range(1,len(Sum),2):
    left = i-1
    if i+k*2 > len(Sum)-1:
        right = len(Sum)-1
    else:
        right = i+k*2
    #print(left,right)
    temp = Sum[right] - Sum[left]
    if ans < temp:
        ans = temp
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
x,y,z,k = map(int, input().split())
A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]

AB = []
for a in A:
	for b in B:
		AB.append(a+b)

AB.sort(reverse=True)
C.sort(reverse=True)

#print(AB)
#print(C)

ABC = []

if len(AB) < k:
	p = len(AB)
else:
	p = k

if len(C) < k:
	q = len(C)
else:
	q = k

for i in range(p):
	for j in range(q):
		ABC.append(AB[i]+C[j])

ABC.sort(reverse=True)
#print(ABC)

for i in range(k):
	print(ABC[i])

Fixed submission:
x,y,z,k = map(int, input().split())
A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]

AB = []
for a in A:
	for b in B:
		AB.append(a+b)

AB.sort(reverse=True)
C.sort(reverse=True)

#print(AB)
#print(C)

ABC = []

if len(AB) < k:
	p = len(AB)
else:
	p = k

if len(C) < k:
	q = len(C)
else:
	q = k

for i in range(p):
	for j in range(q):
		ABC.append(AB[i]+C[j])

ABC.sort(reverse=True)
#print(ABC)

for i in range(k):
	print(ABC[i])
Buggy python submission (verdict: Runtime Error):
b = input()
ans = []
cnt = 0

for i in b:
    if i in "ACTG":
        cnt+=1
    else:
        ans.append(cnt)
        cnt = 0

print(max(ans))


Fixed submission:
b = input()
ans = []
cnt = 0

for i in b:
    if i in "ACTG":
        cnt+=1
    else:
        ans.append(cnt)
        cnt = 0

ans.append(cnt)

print(max(ans))

Buggy python submission (verdict: Runtime Error):
b = input()
ans =0
cnt =0
 
for i in b:
    if i == 'A':
        cnt+=1
    elif i == 'T':
        cnt+=1
    elif i == 'C':
        cnt+=1
    elif i == 'G':
        cnt+=1
    else:
        if ans < cnt:
            ans = cnt
            cnt = 0
 
print(ans)
b = input()
ans =0
cnt =0

for i in b:
    if i == 'A':
        cnt+=1
    elif i == 'T':
        cnt+=1
    elif i == 'C':
        cnt+=1
    elif i == 'G':
        cnt+=1
    else:
        if ans < cnt:
            ans = cnt
            cnt = 0

print(ans)

Fixed submission:
b = input()
ans = []
cnt = 0

for i in b:
    if i in "ACTG":
        cnt+=1
    else:
        ans.append(cnt)
        cnt = 0

ans.append(cnt)

print(max(ans))

Buggy python submission (verdict: Runtime Error):
b = input()
ans =0
cnt =0
 
for i in b:
    if i == 'A':
        cnt+=1
    elif i == 'T':
        cnt+=1
    elif i == 'C':
        cnt+=1
    elif i == 'G':
        cnt+=1
    else:
        if ans < cnt:
            ans = cnt
            cnt = 0
 
print(ans)
b = input()
ans =0
cnt =0

for i in b:
    if i == 'A':
        cnt+=1
    elif i == 'T':
        cnt+=1
    elif i == 'C':
        cnt+=1
    elif i == 'G':
        cnt+=1
    else:
        if ans < cnt:
            ans = cnt
        cnt = 0

print(ans)

Fixed submission:
b = input()
ans = []
cnt = 0

for i in b:
    if i in "ACTG":
        cnt+=1
    else:
        ans.append(cnt)
        cnt = 0

ans.append(cnt)

print(max(ans))
Buggy python submission (verdict: Time Limit Exceeded):
n, q = [int(i) for i in input().split()]
s = input()
l =[]
r =[]
for i in range(q):
    l1, r1 = [int(i) for i in input().split()]
    l.append(l1)
    r.append(r1)

memo = []
for i in range(len(s)-1):
    if s[i]=="A" and s[i+1]=="C":
        memo.append(i)

#print(memo)

for i in range(q):
    cnt = 0
    for j in memo:
        if l[i] <= j+1 <= r[i]-1:
            cnt+=1
    print(cnt)

Fixed submission:
n, q = [int(i) for i in input().split()]
s = input()
l =[]
r =[]
for i in range(q):
    l1, r1 = [int(i) for i in input().split()]
    l.append(l1)
    r.append(r1)

Sum = [0]
for i in range(len(s)):
    if s[i-1]=="A" and s[i]=="C":
        Sum.append(Sum[i]+1)
    else:
        Sum.append(Sum[i])

#print(Sum)
for i in range(q):
    print(Sum[r[i]]-Sum[l[i]])

Buggy python submission (verdict: Time Limit Exceeded):
n, q = [int(i) for i in input().split()]
s = input()
l =[]
r =[]
for i in range(q):
    l1, r1 = [int(i) for i in input().split()]
    l.append(l1)
    r.append(r1)

memo = []
for i in range(len(s)-1):
    if s[i]=="A" and s[i+1]=="C":
        memo.append(i)

#print(memo)

for i in range(q):
    cnt = 0
    for j in memo:
        if l[i] <= j+1 and j+2 <= r[i]:
            cnt+=1
    print(cnt)


Fixed submission:
n, q = [int(i) for i in input().split()]
s = input()
l =[]
r =[]
for i in range(q):
    l1, r1 = [int(i) for i in input().split()]
    l.append(l1)
    r.append(r1)

Sum = [0]
for i in range(len(s)):
    if s[i-1]=="A" and s[i]=="C":
        Sum.append(Sum[i]+1)
    else:
        Sum.append(Sum[i])

#print(Sum)
for i in range(q):
    print(Sum[r[i]]-Sum[l[i]])

Buggy python submission (verdict: Time Limit Exceeded):
n, q = [int(i) for i in input().split()]
s = input()
l =[]
r =[]
for i in range(q):
    l1, r1 = [int(i) for i in input().split()]
    l.append(l1)
    r.append(r1)

for i in range(q):
    str = s[l[i]-1:r[i]]
    #print(str)
    print(str.count("AC"))


Fixed submission:
n, q = [int(i) for i in input().split()]
s = input()
l =[]
r =[]
for i in range(q):
    l1, r1 = [int(i) for i in input().split()]
    l.append(l1)
    r.append(r1)

Sum = [0]
for i in range(len(s)):
    if s[i-1]=="A" and s[i]=="C":
        Sum.append(Sum[i]+1)
    else:
        Sum.append(Sum[i])

#print(Sum)
for i in range(q):
    print(Sum[r[i]]-Sum[l[i]])