Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import sys
n=int(input())
a=list(map(int,input().split()))
x=0
for i in range(n-1):
  if(a[i+1-x]==a[i-x]):
    a.pop(i-x)
    n-=1
    x+=1
    if(n==3):break
if(a[0]==a[1]):
  a.pop(0)
  n-=1
if(n==1):
  print(1)
  sys.exit()
if(n==2):
  print(1)
  sys.exit()
til=a[1]-a[0]
x=0
for i in range(n-1):
  tilt=a[i+1]-a[i]
  if(til*tilt<0):
    x+=1
    if(i+2>=n):
      break
    til=a[i+2]-a[i+1]
print(x+1)

Fixed submission:
import sys
n=int(input())
a=list(map(int,input().split()))
x=0
if(n==1):
  print(1)
  sys.exit()
for i in range(n-1):
  if(a[i+1-x]==a[i-x]):
    a.pop(i-x)
    n-=1
    x+=1
    if(n==3):break
if(a[0]==a[1]):
  a.pop(0)
  n-=1
if(n==2):
  print(1)
  sys.exit()
til=a[1]-a[0]
x=0
for i in range(n-1):
  tilt=a[i+1]-a[i]
  if(til*tilt<0):
    x+=1
    if(i+2>=n):
      break
    til=a[i+2]-a[i+1]
print(x+1)

Buggy python submission (verdict: Runtime Error):
import sys
n=int(input())
a=list(map(int,input().split()))
x=0
for i in range(n-1):
  if(a[i+1-x]==a[i-x]):
    a.pop(i-x)
    n-=1
    x+=1
    if(n==3):break
if(a[0]==a[1]):
  a.pop(0)
  n-=1

if(n==2):
  print(1)
  sys.exit()
til=a[1]-a[0]
x=0
for i in range(n-1):
  tilt=a[i+1]-a[i]
  if(til*tilt<0):
    x+=1
    if(i+2>=n):
      break
    til=a[i+2]-a[i+1]
print(x+1)

Fixed submission:
import sys
n=int(input())
a=list(map(int,input().split()))
x=0
if(n==1):
  print(1)
  sys.exit()
for i in range(n-1):
  if(a[i+1-x]==a[i-x]):
    a.pop(i-x)
    n-=1
    x+=1
    if(n==3):break
if(a[0]==a[1]):
  a.pop(0)
  n-=1
if(n==2):
  print(1)
  sys.exit()
til=a[1]-a[0]
x=0
for i in range(n-1):
  tilt=a[i+1]-a[i]
  if(til*tilt<0):
    x+=1
    if(i+2>=n):
      break
    til=a[i+2]-a[i+1]
print(x+1)

Buggy python submission (verdict: Runtime Error):
import sys
n=int(input())
a=list(map(int,input().split()))
x=0
for i in range(n-1):
  if(a[i+1-x]==a[i-x]):
    a.pop(i)
    n-=1
    x+=1
    if(n==3):break
if(a[0]==a[1]):
  a.pop(0)
  n-=1

if(n==2):
  print(1)
  sys.exit()
til=a[1]-a[0]
x=0
for i in range(n-1):
  tilt=a[i+1]-a[i]
  if(til*tilt<0):
    x+=1
    if(i+2>=n):
      break
    til=a[i+2]-a[i+1]
print(x+1)

Fixed submission:
import sys
n=int(input())
a=list(map(int,input().split()))
x=0
if(n==1):
  print(1)
  sys.exit()
for i in range(n-1):
  if(a[i+1-x]==a[i-x]):
    a.pop(i-x)
    n-=1
    x+=1
    if(n==3):break
if(a[0]==a[1]):
  a.pop(0)
  n-=1
if(n==2):
  print(1)
  sys.exit()
til=a[1]-a[0]
x=0
for i in range(n-1):
  tilt=a[i+1]-a[i]
  if(til*tilt<0):
    x+=1
    if(i+2>=n):
      break
    til=a[i+2]-a[i+1]
print(x+1)
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
if(a==b):
  print("Draw")
elif(a<b):
  if(a==1):
    print("Alice")
  else:
    print("Bob")
else:
  if(b==1):
    print("Alice")
  else:
	print("Bob")


Fixed submission:
a,b=map(int,input().split())
if(a==b):
  print("Draw")
elif(a<b):
  if(a==1):
    print("Alice")
  else:
    print("Bob")
else:
  if(b==1):
    print("Bob")
  else:
    print("Alice")
Buggy python submission (verdict: Runtime Error):
import sys
N,M=map(int,input().split())
Ai=[]
Bi=[]
for i in range(N):
    Ai.append(input())
for i in range(M):
    Bi.append(input())
roop=N-M+1
for i in range(roop):
    for j in range(roop):
        #print("")
        flag=1
        for k in range(roop):
            #print(Ai[i+k][j:j+M])
            if(Ai[i+k][j:j+M]!=Bi[k]):
                flag=0
                break;
        if(flag==1):
            print("Yes")
            sys.exit()
print("No")


Fixed submission:
import sys
N,M=map(int,input().split())
Ai=[]
Bi=[]
for i in range(N):
    Ai.append(input())
for i in range(M):
    Bi.append(input())
roop=N-M+1
for i in range(roop):
    for j in range(roop):
        #print("A")
        flag=1
        for k in range(M):
            #print(Ai[i+k][j:j+M])
            if(Ai[i+k][j:j+M]!=Bi[k]):
                flag=0
                break;
        if(flag==1):
            print("Yes")
            sys.exit()
print("No")
Buggy python submission (verdict: Runtime Error):
n=int(input())
s=input()
x=0
max=0
for i in range(n):
  if(s[i]=="D"):
    x-=1
  else:
    x+=1
    max=max([max,x])
print(max)

Fixed submission:
n=int(input())
s=input()
x=0
ma=0
for i in range(n):
  if(s[i]=="D"):
    x-=1
  else:
    x+=1
    ma=max([ma,x])
print(ma)
Buggy python submission (verdict: Runtime Error):
n=int(input())
i=1
lis=[]
while(i*i<=n):
  count=0
  while(n%i==0):
    count+=1
    n=n//i
  if(count！=0):lis.append(count)
x=1
for i in lis:
  x*=(i+1)
print(x)

Fixed submission:
import sys
n=int(input())
lis=[0for i in range(n)]
for i in range(2,n+1):
  ib=i
  for j in range(2,ib+1):
    while(ib%j==0):
      lis[j-1]+=1
      ib=ib//j
pat=1
for i in lis:pat*=(i+1)
print(pat%(10**9+7))
Buggy python submission (verdict: Runtime Error):
a,op,b=map(str,input().split())
if(op=="+"):
  print(a+b)
else:
  print(a-b)


Fixed submission:
a,op,b=map(str,input().split())
if(op=="+"):
  print(int(a)+int(b))
else:
  print(int(a)-int(b))

Buggy python submission (verdict: Runtime Error):
a,op,b=map(str,input().split())
if(op="+"):
  print(a+b)
else:
  print(a-b)

Fixed submission:
a,op,b=map(str,input().split())
if(op=="+"):
  print(int(a)+int(b))
else:
  print(int(a)-int(b))
Buggy python submission (verdict: Time Limit Exceeded):
import sys
n=int(input())
a=list(map(int,input().split()))
a.sort()
if(n%2==0):
  if(0 in a):
    print(0)
    sys.exit()
  else:
    num=0
    for i in range(1,n,2):
      if(a.count(i)==2):
        num+=1
        a.remove(i)
        a.remove(i)
      else:
        print(0)
        sys.exit()
    if(len(a)>0):
      print(0)
      sys.exit()
else:
  if(a.count(0)!=1):
    print(0)
    sys.exit()
  else:
    a.remove(0)
    num=0
    for i in range(2,n,2):
      if(a.count(i)==2):
        num+=1
        a.remove(i)
        a.remove(i)
      else:
        print(0)
        sys.exit()
print(int(2**num)%(10**9+7))

Fixed submission:
import sys
n=int(input())
a=list(map(int,input().split()))
lis=[0 for i in range(n)]
for i in a:lis[i]+=1
if(1):
  if(lis[0]!=n%2):
    print(0)
    sys.exit()
  num=0
  for i in range(1,n):
    if(i%2==n%2):
      if(lis[i]!=0):
        print(0)
        sys.exit()
    else:
      if(lis[i]!=2):
        print(0)
        sys.exit()
      else:num+=1
  print((2**num)%(10**9+7))
Buggy python submission (verdict: Time Limit Exceeded):
a,b,x=map(int,input().split())
count=0
for i in range(a,b+1):
  if(i%x==0):
    count+=1
print(count)


Fixed submission:
a,b,x=map(int,input().split())
if(a%x==0):
  print(b//x-a//x+1)
else:
  print(b//x-a//x)
Buggy python submission (verdict: Runtime Error):
h,w=map(int,input().split())
alh="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
for i in h:
  s=list(input().split())
  if("snuke" in s):
    ind=s.index("snuke")
    print(alh[ind]+str(i+1))
    break

Fixed submission:
h,w=map(int,input().split())
alh="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
for i in range(h):
  s=list(input().split())
  if("snuke" in s):
    ind=s.index("snuke")
    print(alh[ind]+str(i+1))
    break
Buggy python submission (verdict: Runtime Error):
n=int(input())
s=input()
t=input()
for i in range(n):
  if(t[i]==s[-(i+1)]):
    t=t[1:]
  else:break
print(n+len(t))

Fixed submission:
import sys


n=int(input())
s=input()
t=input()
test=s+t
if(s==t):
    print(len(s))
    sys.exit()
for i in range(1,n+1)[::-1]:
    test=s[0:-i]+t
    if(test[:n]==s and test[-n:]==t):
        print(len(test))
        sys.exit()
        
print(len(s+t))
Buggy python submission (verdict: Runtime Error):
import sys
s=input()
if("C" in s and "F" in s):
  for i in range(len(s)):
    if(s[i]=="C"):c=i
  for i in range(len(s))[::-1]:
    if(s[i]==="F"):f=i
  if(c<f):
    print("Yes")
    sys.exit()
print("No")


Fixed submission:
import sys
s=input()
if("C" in s and "F" in s):
  for i in range(len(s)):
    if(s[i]=="C"):
      c=i
      break
  for i in range(len(s))[::-1]:
    if(s[i]=="F"):
      f=i
      break
  if(c<f):
    print("Yes")
    sys.exit()
print("No")

Buggy python submission (verdict: Runtime Error):
import sys
s=input()
if("C" in s and "C" in s):
  if(s.index("C")<s.index("F")):
    print("Yes")
    sys.exit()
print("No")

Fixed submission:
import sys
s=input()
if("C" in s and "F" in s):
  for i in range(len(s)):
    if(s[i]=="C"):
      c=i
      break
  for i in range(len(s))[::-1]:
    if(s[i]=="F"):
      f=i
      break
  if(c<f):
    print("Yes")
    sys.exit()
print("No")
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
t,a=map(int,input().split())
for i in range(1,n):
  c,d=map(int,input().split())
  times=min(t//c,a//d)
  e,f=c*times,d*times
  while(e<t or f<a):
    #print(e,f)
    times+=1
    e,f=c*times,d*times
    #print(e,f)
  t,a=e,f
print(t+a)


Fixed submission:
n=int(input())
t,a=map(int,input().split())
for i in range(1,n):
  c,d=map(int,input().split())
  if(t/c>a/d):
    if(t%c==0):times=t//c
    else:times=t//c+1
  else:
    if(a%d==0):times=a//d
    else:times=a//d+1
  #print(times)
  t,a=c*times,d*times
  #print(t,a)
print(t+a)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
t,a=map(int,input().split())
for i in range(1,n):
  c,d=map(int,input().split())
  e,f=c,d
  times=1
  while(e<t or f<a):
    #print(e,f)
    times+=1
    e,f=c*times,d*times
    #print(e,f)
  t,a=e,f
print(t+a)


Fixed submission:
n=int(input())
t,a=map(int,input().split())
for i in range(1,n):
  c,d=map(int,input().split())
  if(t/c>a/d):
    if(t%c==0):times=t//c
    else:times=t//c+1
  else:
    if(a%d==0):times=a//d
    else:times=a//d+1
  #print(times)
  t,a=c*times,d*times
  #print(t,a)
print(t+a)
Buggy python submission (verdict: Runtime Error):
s=input()
co="CODEFESTIVAL2016"
cou=0
for i in range(s):
  if(s[i]!=co[i]):cou+=1
print(cou)

Fixed submission:
s=input()
co="CODEFESTIVAL2016"
cou=0
for i in range(len(s)):
  if(s[i]!=co[i]):cou+=1
print(cou)
Buggy python submission (verdict: Time Limit Exceeded):
s=input()
while("ST" in s):
  s=s.replace("ST","",1)
print(len(s))


Fixed submission:
s=input()
n=len(s)
sta=[]
for i in range(n):
  if(s[i]=="S"):
    sta.append("S")
  else:
    if(len(sta)==0 or sta[-1]=="T"):sta.append("T")
    else:sta.pop()
print(len(sta))

Buggy python submission (verdict: Runtime Error):
s=input()
while("ST" in s):
  s.remove("ST")
print(len(s))

Fixed submission:
s=input()
n=len(s)
sta=[]
for i in range(n):
  if(s[i]=="S"):
    sta.append("S")
  else:
    if(len(sta)==0 or sta[-1]=="T"):sta.append("T")
    else:sta.pop()
print(len(sta))
Buggy python submission (verdict: Runtime Error):
Sa=list(input())
Sb=list(input())
Sc=list(input())
Sa.pop()
Sb.pop()
#Sc.pop()
S=Sa.pop(0)
Win="A"
while(S!=""):
  if(S=="a"):
    S=""
    if(len(Sa)!=0):
    	S=Sa.pop(0)
    Win="A"
  elif(S=="b"):
    S=""
    if(len(Sb)!=0):
	    S=Sb.pop(0)
    Win="B"
  elif(S=="c"):
    S=""
    if(len(Sc)!=0):
    	S=Sc.pop(0)
    Win="C"
print(Win)


Fixed submission:
Sa=list(input())
Sb=list(input())
Sc=list(input())
S=Sa.pop(0)
Win="A"
while(S!=""):
  if(S=="a"):
    S=""
    if(len(Sa)!=0):
    	S=Sa.pop(0)
    Win="A"
  elif(S=="b"):
    S=""
    if(len(Sb)!=0):
	    S=Sb.pop(0)
    Win="B"
  elif(S=="c"):
    S=""
    if(len(Sc)!=0):
    	S=Sc.pop(0)
    Win="C"
print(Win)

Buggy python submission (verdict: Runtime Error):
Sa=list(input())
Sb=list(input())
Sc=list(input())
Sa.pop()
Sb.pop()
#Sc.pop()
S=Sa.pop(0)
Win="A"
while(S!=""):
  if(S=="a"):
    S=""
    if(len(Sa)!=0):
    	S=Sa.pop(0)
    Win="A"
  elif(S=="b"):
    S=""
    if(len(Sb)!=0):
	    S=Sb.pop(0)
    Win="B"
  elif(S=="c"):
    S=""
    if(len(Sc)!=0):
    	S=Sc.pop(0)
    Win="C"
print(Win)


Fixed submission:
Sa=list(input())
Sb=list(input())
Sc=list(input())
S=Sa.pop(0)
Win="A"
while(S!=""):
  if(S=="a"):
    S=""
    if(len(Sa)!=0):
    	S=Sa.pop(0)
    Win="A"
  elif(S=="b"):
    S=""
    if(len(Sb)!=0):
	    S=Sb.pop(0)
    Win="B"
  elif(S=="c"):
    S=""
    if(len(Sc)!=0):
    	S=Sc.pop(0)
    Win="C"
print(Win)

Buggy python submission (verdict: Runtime Error):
Sa=list(input())
Sb=list(input())
Sc=list(input())
Sa.pop()
Sb.pop()
Sc.pop()
S=Sa.pop(0)
Win="A"
while(S!=""):
  if(S=="a"):
    S=""
    if(len(Sa)!=0):
    	S=Sa.pop(0)
    Win="A"
  elif(S=="b"):
    S=""
    if(len(Sb)!=0):
	    S=Sb.pop(0)
    Win="B"
  elif(S=="c"):
    S=""
    if(len(Sc)!=0):
    	S=Sc.pop(0)
    Win="C"
print(Win)

Fixed submission:
Sa=list(input())
Sb=list(input())
Sc=list(input())
S=Sa.pop(0)
Win="A"
while(S!=""):
  if(S=="a"):
    S=""
    if(len(Sa)!=0):
    	S=Sa.pop(0)
    Win="A"
  elif(S=="b"):
    S=""
    if(len(Sb)!=0):
	    S=Sb.pop(0)
    Win="B"
  elif(S=="c"):
    S=""
    if(len(Sc)!=0):
    	S=Sc.pop(0)
    Win="C"
print(Win)

Buggy python submission (verdict: Runtime Error):
Sa=list(input())
Sb=list(input())
Sc=list(input())
S=Sa.pop(0)
Win=""
while(S):
  if(S=="a"):
    S=Sa.pop(0)
    Win="A"
  elif(S=="b"):
    S=Sb.pop(0)
  	Win="B"
  elif(S=="c"):
    S=Sc.pop(0)
  	Win="C"
print(Win)

Fixed submission:
Sa=list(input())
Sb=list(input())
Sc=list(input())
S=Sa.pop(0)
Win="A"
while(S!=""):
  if(S=="a"):
    S=""
    if(len(Sa)!=0):
    	S=Sa.pop(0)
    Win="A"
  elif(S=="b"):
    S=""
    if(len(Sb)!=0):
	    S=Sb.pop(0)
    Win="B"
  elif(S=="c"):
    S=""
    if(len(Sc)!=0):
    	S=Sc.pop(0)
    Win="C"
print(Win)
Buggy python submission (verdict: Runtime Error):
s=input()
su=0
for i in range(2**(len(s)-1)):
  b=bin(i)[2:].zfill(len(s)-1)
  calcs=s[0]
  for j in range(len(b)):
    if(b[j]=="0"):calcs+=s[j+1]
    else:calcs+="+"+s[j+1]
  su+=eval(calcs)
print(su)

Fixed submission:
import sys
s=input()
if(len(s)==1):
  print(s)
  sys.exit()
su=0
for i in range(2**(len(s)-1)):
  b=bin(i)[2:].zfill(len(s)-1)
  calcs=s[0]
  for j in range(len(b)):
    if(b[j]=="0"):calcs+=s[j+1]
    else:calcs+="+"+s[j+1]
  su+=eval(calcs)
print(su)

Buggy python submission (verdict: Runtime Error):
s=input()
su=0
for i in range(2**(len(s)-1)):
  b=bin(i)[2:].zfill(len(s)-1)
  calcs=s[0]
  for j in range(len(b)):
    if(b[j]=="0"):calcs+=s[j+1]
    else:calcs+="+"+s[j+1]
  sum+=eval(calcs)
print(sum)

Fixed submission:
import sys
s=input()
if(len(s)==1):
  print(s)
  sys.exit()
su=0
for i in range(2**(len(s)-1)):
  b=bin(i)[2:].zfill(len(s)-1)
  calcs=s[0]
  for j in range(len(b)):
    if(b[j]=="0"):calcs+=s[j+1]
    else:calcs+="+"+s[j+1]
  su+=eval(calcs)
print(su)
Buggy python submission (verdict: Time Limit Exceeded):
n,a=map(int,input().split())
x=list(map(int,input().split()))
s=n*a
dp=[[[0 for i in range(s+1)] for j in range(n+1)] for k in range(n+1)]
dp[0][0][0]=1
for i in range(n):
  for j in range(i+2):
    for k in range(s+1):
      if(k>=x[i]):
        dp[i+1][j][k]=dp[i][j-1][k-x[i]]+dp[i][j][k]
      else:
        dp[i+1][j][k]=dp[i][j][k]
outp=0
for i in range(1,n+1):
  outp+=dp[n][i][i*a]
print(outp)

Fixed submission:
n,a=map(int,input().split())
x=list(map(int,input().split()))
y=[]
for i in x:
  y.append(i-a)
s=2*n*a
dp=[[0 for i in range(s+1)] for j in range(n+1)]
dp[0][n*a]=1
for i in range(n):
  for j in range(s+1):
    x=j-y[i]
    if(0<=x and x<=2*n*a):
      dp[i+1][j]=dp[i][j-y[i]]+dp[i][j]
    else:
      dp[i+1][j]=dp[i][j]

print(dp[n][n*a]-1)
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input())
if(a>0):print("Positive")
elif(a==0):print("Zero")
else:
  if(b>=0):print("Zero")
  else:
    if((b-a+1)%2==0):print("Positive")
    else:print("Negative")

Fixed submission:
a,b=map(int,input().split())
if(a>0):print("Positive")
elif(a==0):print("Zero")
else:
  if(b>=0):print("Zero")
  else:
    if((b-a+1)%2==0):print("Positive")
    else:print("Negative")
Buggy python submission (verdict: Runtime Error):
list = [input() for i in range (2)]
if list[1] == list[2][:-1]:
  print("Yes")
else:
    print("No")

Fixed submission:
list = [input() for i in range (2)]
if list[0] == list[1][:-1]:
  print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
list = [input() for i in range 2]
if list[1] == list[2][:-1]:
  print("Yes")
  else:
    print("No")

Fixed submission:
list = [input() for i in range (2)]
if list[0] == list[1][:-1]:
  print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
list = [input() for _ in range 2]
if list[1] == list[2][:-1]:
  print("Yes")
  else:
    print("No")

Fixed submission:
list = [input() for i in range (2)]
if list[0] == list[1][:-1]:
  print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
A,B,C,K = input().split()
if A >= K:
  print(K)
elif A+B >= K:
  print(A)
else:
  print(A + A + B - K)

Fixed submission:
A,B,C,K = input().split()
if int(A) >= int(K):
  print(K)
elif int(A)+int(B) >= int(K):
  print(A)
else:
  print(int(A) + int(A) + int(B) - int(K))

Buggy python submission (verdict: Runtime Error):
A,B,C,K = input().split()
if A > K:
  print(K)
elif A+B > K:
  print(A)
else:
  print(2*A + B - K)

Fixed submission:
A,B,C,K = input().split()
if int(A) >= int(K):
  print(K)
elif int(A)+int(B) >= int(K):
  print(A)
else:
  print(int(A) + int(A) + int(B) - int(K))
Buggy python submission (verdict: Runtime Error):
,K = (int(x) for x in input().split())
S = input()
if N <= 50:
    komoji = S[K-1:K].lower()

    Out = S[:K-1] + komoji + S[K:]

    print(Out)

Fixed submission:
N,K = (int(x) for x in input().split())
S = input()
if 1 <= N <= 50 and 1 <=K <= N and len(S) == N :
    komoji = S[K-1:K].lower()

    Out = S[:K-1] + komoji + S[K:]

    print(Out)

Buggy python submission (verdict: Runtime Error):
N,K = int(input()), int(input())
S = input()
if N <= 50:
    komoji = S[K-1:K].lower()

    Out = S[:K-1] + komoji + S[K:]

    print(Out)

Fixed submission:
N,K = (int(x) for x in input().split())
S = input()
if 1 <= N <= 50 and 1 <=K <= N and len(S) == N :
    komoji = S[K-1:K].lower()

    Out = S[:K-1] + komoji + S[K:]

    print(Out)

Buggy python submission (verdict: Runtime Error):
N,K = int(input()), int(input())
S = input()

komoji = S[K-1:K].lower()

Out = S[:K-1] + komoji + S[K:N+1]

print(Out)

Fixed submission:
N,K = (int(x) for x in input().split())
S = input()
if 1 <= N <= 50 and 1 <=K <= N and len(S) == N :
    komoji = S[K-1:K].lower()

    Out = S[:K-1] + komoji + S[K:]

    print(Out)

Buggy python submission (verdict: Runtime Error):
N,K = int(input('N = ')), int(input('K = '))
S = input('S = ')

komoji = S[K-1:K].lower()

Out = S[:K-1] + komoji + S[K:N+1]

print(Out)

Fixed submission:
N,K = (int(x) for x in input().split())
S = input()
if 1 <= N <= 50 and 1 <=K <= N and len(S) == N :
    komoji = S[K-1:K].lower()

    Out = S[:K-1] + komoji + S[K:]

    print(Out)
Buggy python submission (verdict: Runtime Error):
s=list(input())
t=list(input())

l=list(set(t)-set(s))

if l[0]==t[-1] and len(l)==1:
  print('Yes')
  
else:
  print('No')


Fixed submission:
import string

l=list(string.ascii_lowercase)


s=input()
t=input()
a=0

for i in range(26):
  if t==s+l[i]:
    print('Yes')
    a+=1
    break
    

if a==0:
  print('No')
Buggy python submission (verdict: Time Limit Exceeded):
import math
import itertools
 
n,m,q = map(int,input().split())
li=[input() for i in range(q)]
 
ans_list=list()
ans=0
xans=0
 
lis =  list(range(1,m+1))
for team in itertools.combinations_with_replacement(lis,n):
  
    for i in range(q):
      
      lix=li[i].split()
      
      if team[int(lix[1])-1]-team[int(lix[0])-1]==int(lix[2]):
        ans=int(lix[3])
        xans+=ans
        
       
        
    ans_list+=[xans]
    xans=0
      
    
    
print(max(ans_list))

Fixed submission:
import math
import itertools

n,m,q = map(int,input().split())
li=[input() for i in range(q)]

ans_list=list()
ans=0
xans=0

lis =  list(range(1,m+1))
for team in itertools.combinations_with_replacement(lis,n):
  
    for i in range(q):
      
      lix=li[i].split()
      
      if team[int(lix[1])-1]-team[int(lix[0])-1]==int(lix[2]):
        ans=int(lix[3])
        xans+=ans
        
       
        
    ans_list+=[xans]
    xans=0
      
    
    
print(max(ans_list))

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

n,m,q = map(int,input().split())
li=[input() for i in range(q)]

ans_list=list()
ans=0

lis =  list(range(1,m+1))
for team in itertools.combinations(lis, n):

    for i in range(q):
      lix=li[i].split()
      
      if team[int(lix[1])-1]-team[int(lix[0])-1]==int(lix[2]):
        ans+=int(lix[3])
        
    ans_list+=[ans]
    ans=0
      
    
    
print(max(ans_list))


Fixed submission:
import math
import itertools

n,m,q = map(int,input().split())
li=[input() for i in range(q)]

ans_list=list()
ans=0
xans=0

lis =  list(range(1,m+1))
for team in itertools.combinations_with_replacement(lis,n):
  
    for i in range(q):
      
      lix=li[i].split()
      
      if team[int(lix[1])-1]-team[int(lix[0])-1]==int(lix[2]):
        ans=int(lix[3])
        xans+=ans
        
       
        
    ans_list+=[xans]
    xans=0
      
    
    
print(max(ans_list))
Buggy python submission (verdict: Time Limit Exceeded):
a=int(input())
li = list(map(int,input().split()))

i=1
while i<=a:
  print(li.count(i))
  i+=1

Fixed submission:
from collections import Counter

n = int(input())
li = input().split()
a = Counter(li)


for i in range(1,n+1):
  print(a[str(i)])

Buggy python submission (verdict: Time Limit Exceeded):
a=int(input())
li = list(map(int,input().split()))

for i in range(1,a+1):
  print(li.count(i))

Fixed submission:
from collections import Counter

n = int(input())
li = input().split()
a = Counter(li)


for i in range(1,n+1):
  print(a[str(i)])
Buggy python submission (verdict: Runtime Error):
import math from gcd
k=input()

ans=0
i=0

for a in range(k+1):
  for b in range(k+1):
    i==gcd(a,B)
    for c in range(k+1):
      ans+=gcd(i,c)
      
print(ans)

Fixed submission:
n=input()

a=n.count('7')

if a==0:
  print('No')
else:
  print('Yes')