Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import collections
import math
n=int(input())
s=[''.join(list(input()).sort()) for _ in range(n)]
l=list(collections.Counter(s).values())
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

c=0
for i in range(len(l)):
    k=int(l[i])
    if k!=1:c+=combinations_count(k,2)
print(c)

Fixed submission:
import collections
import math
n=int(input())
s=[]
for i in range(n):
    sl=list(input())
    sl.sort()
    s.append("".join(sl))

l=list(collections.Counter(s).values())
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

c=0
for i in range(len(l)):
    k=int(l[i])
    if k!=1:c+=combinations_count(k,2)
print(c)

Buggy python submission (verdict: Runtime Error):
import collections
import math
n=int(input())
s=[]
for i in range(n):
    sl=list(input())
    sl.sort()
    s.append("".join(sl))

l=collections.Counter(s).values()
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

c=0
for i in range(len(l)):
    if l[i]!=1:c+=combinations_count(l[i],2)
print(c)

Fixed submission:
import collections
import math
n=int(input())
s=[]
for i in range(n):
    sl=list(input())
    sl.sort()
    s.append("".join(sl))

l=list(collections.Counter(s).values())
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

c=0
for i in range(len(l)):
    k=int(l[i])
    if k!=1:c+=combinations_count(k,2)
print(c)

Buggy python submission (verdict: Runtime Error):
import collections
import math
n=int(input())
s=[''.join(list(input()).sort()) for _ in range(n)]
l=collections.Counter(s).values()
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

c=0
for i in range(len(l)):
    if l[i]!=1:c+=combinations_count(l[i],2)
print(c)

Fixed submission:
import collections
import math
n=int(input())
s=[]
for i in range(n):
    sl=list(input())
    sl.sort()
    s.append("".join(sl))

l=list(collections.Counter(s).values())
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

c=0
for i in range(len(l)):
    k=int(l[i])
    if k!=1:c+=combinations_count(k,2)
print(c)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
h=list(map(int,input().split()))
for i in range(n-1):
    for j in range(i+1,n):
        if h[i]-1>h[j]:
            print('No')
            exit()
print('Yes')

Fixed submission:
n=int(input())
h=list(map(int,input().split()))
k=h[0]-1
for i in range(1,n-1):
    if k<=h[i]-1:k=h[i]-1
    if k>h[i+1]:
        print('No')
        exit()
print('Yes')
Buggy python submission (verdict: Runtime Error):
l,r=map(int,input().split())
k=min(l%2019,(r+1)%2019)
m=max(l%2019,(r+1)%2019)
a=list(range(k,m))
a.sort()
print(min(i*j % 2019 for i in a for j in a if i<j))

Fixed submission:
l,r=map(int,input().split())
a=range(l,r+1)[:673]
print(min(i*j % 2019 for i in a for j in a if i<j))

Buggy python submission (verdict: Runtime Error):
l,r=map(int,input().split())
k=min(l%2019,(r+1)%2019)
m=max(l%2019,(r+1)%2019)
a=list(range(k,m))
a.sort()
print(a[0]*a[1])

Fixed submission:
l,r=map(int,input().split())
a=range(l,r+1)[:673]
print(min(i*j % 2019 for i in a for j in a if i<j))
Buggy python submission (verdict: Runtime Error):
s=input()
s.sort()
if s[0]==s[1] and s[2]==s[3]:print('Yes')
else:print('No')

Fixed submission:
s=list(input())
s.sort()
if s[0]==s[1] and s[2]==s[3] and s[1]!=s[2]:print('Yes')
else:print('No')
Buggy python submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
cdgcd=(c*d)//fractions.gcd(c,d)
print(b-(a-1)-(b//c) +((a-1)//c) -(b//d) +((a-1)//d) +(b//cdgcd) -(a-1)//cdgcd)

Fixed submission:
import fractions
a,b,c,d=map(int,input().split())
cdgcd=(c*d)//fractions.gcd(c,d)
print(b-(a-1)-(b//c) +((a-1)//c) -(b//d) +((a-1)//d) +(b//cdgcd) -(a-1)//cdgcd)

Buggy python submission (verdict: Time Limit Exceeded):
a,b,c,d=map(int,input().split())
k=0
for i in range(a,b+1):
    if i%c!=0 and i%d!=0:k+=1
print(k)

Fixed submission:
import fractions
a,b,c,d=map(int,input().split())
cdgcd=(c*d)//fractions.gcd(c,d)
print(b-(a-1)-(b//c) +((a-1)//c) -(b//d) +((a-1)//d) +(b//cdgcd) -(a-1)//cdgcd)
Buggy python submission (verdict: Runtime Error):
p,q,r=map(int,input().split())
print(min(p,q,r)+min(p,q,r)[1])

Fixed submission:
k=list(map(int,input().split()))
k.sort()
print(int(k[0])+int(k[1]))
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
ab=[map(int,input().split()) for _ in range(m)]
b=min(ab[i][1] for i in range(m))
a=max(ab[i][0] for i in range(m))
print(b-a+1)

Fixed submission:
n,m=map(int,input().split())
ab=[list(map(int,input().split())) for _ in range(m)]
b=min(ab[i][1] for i in range(m))
a=max(ab[i][0] for i in range(m))
if b-a+1<0:print(0)
else:print(b-a+1)
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
a=list(map(int,input().split()))
l=[list(map(int,input().split())) for _ in range(m)]
a.sort(reverse=True)
l.sort(key=lambda x:x[1],reverse=True)
o=sum(a)
for i in range(m):
    for j in range(1,l[i][0]+1):
        if a[-1]>=l[i][1]:
            print(o)
            exit()
        else:
            r=a.pop(-1)
            o-=r
            o+=l[i][1]
print(o)

Fixed submission:
n,m=map(int,input().split())
a=list(map(int,input().split()))
l=[list(map(int,input().split())) for _ in range(m)]
a.sort(reverse=True)
l.sort(key=lambda x:x[1],reverse=True)
o=sum(a)
for i in range(m):
    for j in range(1,l[i][0]+1):
        if len(a)==0:
            print(o)
            exit()
        if a[-1]>=l[i][1]:
            print(o)
            exit()
        else:
            r=a.pop(-1)
            o-=r
            o+=l[i][1]
print(o)
Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
l=0
if n>=k:
    for i in range(1,k):
        if math.log2(k/i)==n:l+=(1-(0.5**n))/n
        else: l+= (1-(0.5**((math.log2(k/i)//1) +1)))/n
    print(1-l)
else:
    for i in range(1,n+1):
        if math.log2(k/i)==n:l+=(0.5**n)/n
        else: l+= (0.5**((math.log2(k/i)//1) +1))/n
    print(l)

Fixed submission:
import math
n,k=map(int,input().split())
s=0
for i in range(1,n+1):
    if i<k:
        s+=0.5**(-(-math.log(k/i,2)//1))
    else:
        s+=1
print(s/n)
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
m=[]
p=[]
s=0
c=0
for i in range(n):
    s+=abs(a[i])
    if a[i]<0:
        c+=1
        c%=2
        m.append(a[i])
    else:p.append(a[i])
if c==0:print(s)
else:
    m.sort()
    p.sort()
    if abs(m[-1])>abs(p[0]):print(s+m[-1]-p[0]-m[-1]-p[0])
    else:print(s)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
m=[]
p=[]
s=0
c=0
for i in range(n):
    s+=abs(a[i])
    if a[i]<0:
        c+=1
        c%=2
        m.append(a[i])
    else:p.append(a[i])
if c==0:print(s)
else:
    m.sort()
    if len(p)==0:
        print(s+2*m[-1])
        exit()
    p.sort()
    if abs(m[-1])>abs(p[0]):print(s+m[-1]-p[0]-m[-1]-p[0])
    else:print(s+m[-1]*2)
Buggy python submission (verdict: Runtime Error):
a,b,c,d,e,k= map(int,input().split())
if e-a>k:print(':(')
else:print('Yay!')

Fixed submission:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
if e-a>k:print(':(')
else:print('Yay!')
Buggy python submission (verdict: Runtime Error):
n=int(input())
t=[int(input()) for _ in range(4)]
if n//min(t)<1:
    n//min(t)=1
print(n//min(t) +4)

Fixed submission:
n=int(input())
t=[int(input()) for _ in range(5)]
k=(n-1)//min(t)
print(k+5)

Buggy python submission (verdict: Runtime Error):
n=int(input())
t=[int(input()) for _ in range(5)]
if n//min(t)<1:
    n//min(t)=1
print(n//min(t) +4)

Fixed submission:
n=int(input())
t=[int(input()) for _ in range(5)]
k=(n-1)//min(t)
print(k+5)

Buggy python submission (verdict: Runtime Error):
n=int(input())
t=[int(input()) for _ in range(n)]
if n//min(t)<1:
    n//min(t)=1
print(n//min(t) +4)

Fixed submission:
n=int(input())
t=[int(input()) for _ in range(5)]
k=(n-1)//min(t)
print(k+5)
Buggy python submission (verdict: Runtime Error):
b=str(input())
print(b.translate(b.maketrans({'A':'x'},{'C':'y'},{'T':'A'},{'G':'C'},{'x':'C'},{'y':'G'})))

Fixed submission:
b=str(input())
print(b.translate(b.maketrans({'A':'T','C':'G','T':'A','G':'C'})))

Buggy python submission (verdict: Runtime Error):
b=input()
print(b.translate(b.maketrans({'A':'x'},{'C':'y'},{'T':'A'},{'G':'C'},{'x':'C'},{'y':'G'})))

Fixed submission:
b=str(input())
print(b.translate(b.maketrans({'A':'T','C':'G','T':'A','G':'C'})))

Buggy python submission (verdict: Runtime Error):
b=input()
print(b.translate(b.maketrans('A':'x','C':'y','T':'A','G':'C','x':'C','y':'G')))

Fixed submission:
b=str(input())
print(b.translate(b.maketrans({'A':'T','C':'G','T':'A','G':'C'})))

Buggy python submission (verdict: Runtime Error):
b=input()
print(b.translate(str.maketrans('A':'x','C':'y','T':'A','G':'C','x':'C','y':'G')))

Fixed submission:
b=str(input())
print(b.translate(b.maketrans({'A':'T','C':'G','T':'A','G':'C'})))
Buggy python submission (verdict: Time Limit Exceeded):
n,q=map(int,input().split())
s=input()
lr=[list(map(int,input().split())) for _ in range(q)]
s1=len(list(s))
l=[0]*(s1-1)
for i in range(s1):
    if s[i:i+2]=='AC':
        l[i]+=1
for j in range(q):
    print( sum( l [lr[j][0]-1:lr[j][1]-1] ))

Fixed submission:
n,q=map(int,input().split())
s=input()
lr=[list(map(int,input().split())) for _ in range(q)]
l=[0]*(n+1)
for i in range(n):
    if s[i:i+2]=='AC':
        l[i+1]=l[i]+1
    else:l[i+1]=l[i]
for j in range(q):
    print( l[lr[j][1]-1] - l[lr[j][0]-1])

Buggy python submission (verdict: Runtime Error):
n,q=map(int,input().split())
s=input()
lr=[list(map(int,input().split())) for _ in range(q)]
s1=len(list(s))
l=[0]*(s1-1)
for i in range(s1):
    if s[i]=='A' and s[i+1]=='C':
        l[i]+=1
for j in range(q):
    print( sum( l [lr[j][0]-1:lr[j][1]-1] ))

Fixed submission:
n,q=map(int,input().split())
s=input()
lr=[list(map(int,input().split())) for _ in range(q)]
l=[0]*(n+1)
for i in range(n):
    if s[i:i+2]=='AC':
        l[i+1]=l[i]+1
    else:l[i+1]=l[i]
for j in range(q):
    print( l[lr[j][1]-1] - l[lr[j][0]-1])

Buggy python submission (verdict: Runtime Error):
n,q=map(int,input().split())
s=input()
lr=[list(map(int,input().split())) for _ in range(q)]
s1=len(list(s))
l=[0]*(s1-1)
for i in range(s1//2):
    if s[2*i]=='A' and s[2*i+1]=='C':
        l[2*i]+=1
    if s[2*i+1]=='A' and s[2*(i+1)]=='C':
        l[2*i+1]+=1
for j in range(q):
    print( sum( l [lr[j][0]-1:lr[j][1]-1] ))

Fixed submission:
n,q=map(int,input().split())
s=input()
lr=[list(map(int,input().split())) for _ in range(q)]
l=[0]*(n+1)
for i in range(n):
    if s[i:i+2]=='AC':
        l[i+1]=l[i]+1
    else:l[i+1]=l[i]
for j in range(q):
    print( l[lr[j][1]-1] - l[lr[j][0]-1])
Buggy python submission (verdict: Runtime Error):
s1,s2,s3=input().split('/')
if s1<2018:print('Heisei')
elif s1=='2019' and s2<='04':print('Heisei')
else:print('TBD')

Fixed submission:
s=input().split('/')
if int(s[0])<2018:print('Heisei')
elif int(s[0])==2019 and int(s[1])<=4:print('Heisei')
else:print('TBD')

Buggy python submission (verdict: Runtime Error):
s1,s2,s3=input().split('/')
s=s1+s2+s3
if s<=20190430:print('Heisei')
else:print('TBD')

Fixed submission:
s=input().split('/')
if int(s[0])<2018:print('Heisei')
elif int(s[0])==2019 and int(s[1])<=4:print('Heisei')
else:print('TBD')

Buggy python submission (verdict: Runtime Error):
s=str(input().replace('/','').strip())
if s<=20190430:print('Heisei')
else:print('TBD')

Fixed submission:
s=input().split('/')
if int(s[0])<2018:print('Heisei')
elif int(s[0])==2019 and int(s[1])<=4:print('Heisei')
else:print('TBD')

Buggy python submission (verdict: Runtime Error):
s=input().replace('/','').strip()
if s<=20190430:print('Heisei')
else:print('TBD')

Fixed submission:
s=input().split('/')
if int(s[0])<2018:print('Heisei')
elif int(s[0])==2019 and int(s[1])<=4:print('Heisei')
else:print('TBD')
Buggy python submission (verdict: Runtime Error):
import fractions
from functools import reduce
n=int(input())
a=list(map(int,input().split()))
def gcd(*numbers):
    return reduce(gcd, numbers)
def gcd_list(numbers):
    return reduce(gcd, numbers)
print(gcd_list(a))

Fixed submission:
import fractions
from functools import reduce
n=int(input())
a=list(map(int,input().split()))
print(reduce(fractions.gcd,a))

Buggy python submission (verdict: Runtime Error):
import math
from fractions import gcd
from functools import reduce
n=int(input())
a=list(map(int,input().split()))
def gcd(*numbers):
    return reduce(math.gcd, numbers)
def gcd_list(numbers):
    return reduce(math.gcd, numbers)
print(gcd_list(a))

Fixed submission:
import fractions
from functools import reduce
n=int(input())
a=list(map(int,input().split()))
print(reduce(fractions.gcd,a))

Buggy python submission (verdict: Runtime Error):
from fractions import gcd
from functools import reduce
n=int(input())
a=list(map(int,input().split()))
def gcd(*numbers):
    return reduce(gcd, numbers)
def gcd_list(numbers):
    return reduce(gcd, numbers)
print(gcd_list(a))

Fixed submission:
import fractions
from functools import reduce
n=int(input())
a=list(map(int,input().split()))
print(reduce(fractions.gcd,a))

Buggy python submission (verdict: Runtime Error):
from fractions import gcd
from functools import reduce
n=int(input())
a=list(map(int,input().split()))
def gcd(*numbers):
    return reduce(math.gcd, numbers)
def gcd_list(numbers):
    return reduce(math.gcd, numbers)
print(gcd_list(a))

Fixed submission:
import fractions
from functools import reduce
n=int(input())
a=list(map(int,input().split()))
print(reduce(fractions.gcd,a))
Buggy python submission (verdict: Runtime Error):
h=list(map(int,input().split()))
l=[0]
c='plus'
for i in range(n-1):
    if c=='minus' and h[i]<=h[i+1]:
        l.append(i)
    if h[i]<=h[i+1]:c='plus'
    else:c='minus'

w=0
m=0
for i in range(len(l)-1):
    w+=max(h[l[i]:l[i+1]+1])-m
    m=h[l[i+1]]
w+=max(h[l[-1]:n])-m
print(w)

Fixed submission:
n=int(input())
h=list(map(int,input().split()))
l=[0]
c='plus'
for i in range(n-1):
    if c=='minus' and h[i]<=h[i+1]:
        l.append(i)
    if h[i]<=h[i+1]:c='plus'
    else:c='minus'

w=0
m=0
for i in range(len(l)-1):
    w+=max(h[l[i]:l[i+1]+1])-m
    m=h[l[i+1]]
w+=max(h[l[-1]:n])-m
print(w)

Buggy python submission (verdict: Runtime Error):
n=int(input())
h=list(map(int,input().split()))
l=[0]
c='plus'
for i in range(n-1):
    if c=='minus' and h[i]<=h[i+1]:
        l.append(i)
    if h[i]<=h[i+1]:c='plus'
    else:c='minus'

w=0
m=0
for i in range(len(l)-1):
    w+=max(h[l[i]:l[i+1]+1])-m
    m=h[l[i+1]]
w+=max(h[l[-1]:-1])-m
print(w)

Fixed submission:
n=int(input())
h=list(map(int,input().split()))
l=[0]
c='plus'
for i in range(n-1):
    if c=='minus' and h[i]<=h[i+1]:
        l.append(i)
    if h[i]<=h[i+1]:c='plus'
    else:c='minus'

w=0
m=0
for i in range(len(l)-1):
    w+=max(h[l[i]:l[i+1]+1])-m
    m=h[l[i+1]]
w+=max(h[l[-1]:n])-m
print(w)
Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,input().split())
h=[int(input()) for _ in range(n)]
h.sort()
l=[]
for i in range(n-k+1):
    l.append(max(h[i:i+k])-min(h[i:i+k]))
print(min(l))

Fixed submission:
n,k=map(int,input().split())
h=[int(input()) for _ in range(n)]
h.sort()
l=[]
for i in range(n-k+1):
    l.append(h[i+k-1] - h[i])
print(min(l))

Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,input().split())
h=[int(input()) for _ in range(n)]
h.sort()
l=[]
for i in range(n-k+1):
    l.append(max(h[i:i+k])-min(h[i:i+k]))
print(min(l))

Fixed submission:
n,k=map(int,input().split())
h=[int(input()) for _ in range(n)]
h.sort()
l=[]
for i in range(n-k+1):
    l.append(h[i+k-1] - h[i])
print(min(l))
Buggy python submission (verdict: Runtime Error):
n=int(input())
t,a=map(int,input().split())
h=map(int,input().split())
t1=[]
for i in range(n):
    t1.append(abs(a-(t-h[i]*0.006)))
print(t1.index(min(t1))+1)

Fixed submission:
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
t1=[]
for i in range(n):
    t1.append(abs(a-(t-h[i]*0.006)))
print(t1.index(min(t1))+1)
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
py=[list(map(int,input().split()))]
l=[1]*n
for i in range(m):
    py[i].append(i+1)
py.sort()
for i in range(m):
    py[i].append( str(py[i][0]).zfill(6) + str(l[py[i][0]-1]).zfill(6))
    l[py[i][0]-1]+=1
py.sort(key=lambda x:x[2])
for i in range(m):
    print(py[i][-1])

Fixed submission:
n,m=map(int,input().split())
py=[list(map(int,input().split())) for _ in range(m)]
l=[1]*n
for i in range(m):
    py[i].append(i+1)
py.sort()
for i in range(m):
    py[i].append( str(py[i][0]).zfill(6) + str(l[py[i][0]-1]).zfill(6))
    l[py[i][0]-1]+=1
py.sort(key=lambda x:x[2])
for i in range(m):
    print(py[i][-1])
Buggy python submission (verdict: Runtime Error):
n=int(input())
if n==1:print('Hello World')
a=int(input())
b=int(input())
else:print(a+b)

Fixed submission:
n=int(input())
if n==1:print('Hello World')
else:
  a=int(input())
  b=int(input())
  print(a+b)

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=int(input())
b=int(input())
if n==1:print('Hello World')
elif n==2:print(a+b)

Fixed submission:
n=int(input())
if n==1:print('Hello World')
else:
  a=int(input())
  b=int(input())
  print(a+b)

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=int(input())
b=int(input())
if n==1:print('Hello World')
else:print(a+b)

Fixed submission:
n=int(input())
if n==1:print('Hello World')
else:
  a=int(input())
  b=int(input())
  print(a+b)
Buggy python submission (verdict: Runtime Error):
k=list(map(str,input().split()))
print(int(max(k)+max(k)[1])+int(min(k)))


Fixed submission:
k=list(map(str,input().split()))
k.sort()
l=str(k[2])+str(k[1])
print(int(l)+int(k[0]))
Buggy python submission (verdict: Runtime Error):
n=int(input())
w=[input() for _ in range(n)]
if len(set(w))!=n:print('No')
else:
    for i in range(n-1):
        if w[i][-1]==w[i+1][0]:k+=1
    if k==n-1:print('Yes')
    else:print('No')

Fixed submission:
n=int(input())
k=0
w=[input() for _ in range(n)]
if len(set(w))!=n:print('No')
else:
    for i in range(n-1):
        if w[i][-1]==w[i+1][0]:k+=1
    if k==n-1:print('Yes')
    else:print('No')
Buggy python submission (verdict: Runtime Error):
import math
import numpy as np
from functools import reduce
n,x=map(int,input().split())
p=list(map(int,input().split()))
p=np.array(p)
p=p-x

def gcd_list(numbers):
    return reduce(math.gcd, numbers)
print(gcd_list(p))

Fixed submission:
import math
import numpy as np
import functools
import fractions
n,x=map(int,input().split())
p=list(map(int,input().split()))
p=np.array(p)
p=abs(p-x)
print(functools.reduce(fractions.gcd, p))

Buggy python submission (verdict: Runtime Error):
import math
import numpy as np
from functools import reduce
n,x=map(int,input().split())
p=list(map(int,input().split()))
p=np.array(p)
p=p-x

def gcd_list(numbers):
    return reduce(math.gcd, numbers)
print(gcd=list(p))

Fixed submission:
import math
import numpy as np
import functools
import fractions
n,x=map(int,input().split())
p=list(map(int,input().split()))
p=np.array(p)
p=abs(p-x)
print(functools.reduce(fractions.gcd, p))
Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int,input().split())
a=list(map(int,input().split()))
l=[0]*(n+1)
for i in range(n):
    l[i]+=a[i]
    l[i+1]+=l[i]
c=0
for i in range(n):
    for j in range(i,n):
        if i==0:
            if l[j]%m==0:c+=1
        else:
            if (l[j]-l[i-1])%m==0:c+=1
print(c)

Fixed submission:
from itertools import accumulate
from collections import Counter
n,m=map(int,input().split())
s=[0]+list(map(lambda x:x%m,list(accumulate(list(map(int,input().split()))))))
ans=0
for i in Counter(s).values():
    ans+=(i*(i-1)//2)
print(ans)
Buggy python submission (verdict: Runtime Error):
from collections import Counter
l=input()
s=list()
k=0
if s[0]=='A':
    for i in range(2,len(s)-1):
        if s[i]=='C':
            k+=1
    if k==1:
        if l.replace('A', 'a').replace('C', 'c') == l.lower():print('AC')
        else:print('WA')
    else:print('WA')
else:print('WA')

Fixed submission:
from collections import Counter
l=input()
s=list(l)
k=0
if s[0]=='A':
    for i in range(2,len(s)-1):
        if s[i]=='C':
            k+=1
    if k==1:
        if l.replace('A', 'a').replace('C', 'c') == l.lower():print('AC')
        else:print('WA')
    else:print('WA')
else:print('WA')

Buggy python submission (verdict: Runtime Error):
from collections import Counter
s=list(input())
k=0
if s[0]=='A':
    for i in range(2,len(s)-1):
        if s[i]=='C':
            k+=1
    if k==1:
        if s.replace('A', 'a').replace('C', 'c') == s.lower():print('AC')
        else:print('WA')
    else:print('WA')
else:print('WA')

Fixed submission:
from collections import Counter
l=input()
s=list(l)
k=0
if s[0]=='A':
    for i in range(2,len(s)-1):
        if s[i]=='C':
            k+=1
    if k==1:
        if l.replace('A', 'a').replace('C', 'c') == l.lower():print('AC')
        else:print('WA')
    else:print('WA')
else:print('WA')
Buggy python submission (verdict: Runtime Error):
a1,a2,a3=map(int,input().split())
k=sorted[a1,a2,a3]
print( abs(k[2]-k[1]) + abs(k[1]-k[2]))

Fixed submission:
k=list(map(int,input().split()))
k.sort() #デフォルトは昇順
print( abs(k[0]-k[1]) + abs(k[1]-k[2]))

Buggy python submission (verdict: Runtime Error):
a1,a2,a3=map(int,input().split())
k=[a1,a2,a3]
print( abs(max(k)-max(k)[1]) + abs(max(k)[1]-max(k)[2]))

Fixed submission:
k=list(map(int,input().split()))
k.sort() #デフォルトは昇順
print( abs(k[0]-k[1]) + abs(k[1]-k[2]))

Buggy python submission (verdict: Runtime Error):
k=list(map(int,input().split()))
print( abs(max(k)-max(k)[1]) + abs(max(k)[1]-max(k)[2]))

Fixed submission:
k=list(map(int,input().split()))
k.sort() #デフォルトは昇順
print( abs(k[0]-k[1]) + abs(k[1]-k[2]))
Buggy python submission (verdict: Runtime Error):
s=list(input())
t=list(input())
k=0
for i in range(len(t)):
    if s[i]==t[i]:        
        print('Yes')
        exit()
    elif k=len(t):print('No')
    else:
      s.insert(0,s.pop(-1))
      k+=1

Fixed submission:
s=input()
t=input()
for i in range(len(s)):
    if s[i:len(s)]+s[:i]==t:
        print('Yes')
        exit()
print('No')