Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
s = input()
if s.count("7") == 2 and s.count("5") == 1:
  print("YES")
else:
  print("NO)

Fixed submission:
s = input()
if s.count("7") == 1 and s.count("5") == 2:
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Runtime Error):
print("".join(sorted([input() for _ in range(input().split()[0]))))

Fixed submission:
print("".join(sorted([input() for _ in range(int(input().split()[0]))])))
Buggy python submission (verdict: Runtime Error):
n = input().split()
dis = int(n[1]) - int(n[0])
cnt = 0
for i in range(dis):
    nm = str(i + a)
    if nm[0] == nm[-1]:
        if nm[1] == nm[-2]:
            cnt += 1

print(cnt)

Fixed submission:
n = input().split()
dis = int(n[1]) - int(n[0])
cnt = 0
for i in range(dis+1):
    nm = str(i + int(n[0]))
    if nm[0] == nm[-1]:
        if nm[1] == nm[-2]:
            cnt += 1

print(cnt)

Buggy python submission (verdict: Runtime Error):
n = input().split()
dis = int(n[1]) - int(n[0])
cnt = 0
for i in range(dis):
    nm = str(i + a)
    if nm[0] == nm[-1]:
        if nm[1] == nm[-2]:
            cnt += 1

print(cnt)

Fixed submission:
n = input().split()
dis = int(n[1]) - int(n[0])
cnt = 0
for i in range(dis+1):
    nm = str(i + int(n[0]))
    if nm[0] == nm[-1]:
        if nm[1] == nm[-2]:
            cnt += 1

print(cnt)

Buggy python submission (verdict: Runtime Error):
a,b = input().split()
dis = int(b) - int(a)
cnt = 0
for i in range(dis):
    nm = str(i + a)
    if nm[0] == nm[-1]:
        if nm[1] == nm[-2]:
            cnt += 1

print(cnt)

Fixed submission:
n = input().split()
dis = int(n[1]) - int(n[0])
cnt = 0
for i in range(dis+1):
    nm = str(i + int(n[0]))
    if nm[0] == nm[-1]:
        if nm[1] == nm[-2]:
            cnt += 1

print(cnt)

Buggy python submission (verdict: Runtime Error):
a,b = map(int, input().split())
dis = b - a
cnt = 0
for i in range(dis):
    nm = str(i + dis)
    if nm[0] == nm[4]:
        if nm[1] == nm[3]:
            cnt += 1

print(cnt)

Fixed submission:
n = input().split()
dis = int(n[1]) - int(n[0])
cnt = 0
for i in range(dis+1):
    nm = str(i + int(n[0]))
    if nm[0] == nm[-1]:
        if nm[1] == nm[-2]:
            cnt += 1

print(cnt)
Buggy python submission (verdict: Runtime Error):
print(int(int(input())num / 3))

Fixed submission:
print(int(int(input()) / 3))
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
n = int(input())
a = int(input())

if n % 500 =< a:
    print("Yes")
else:
    print("No")


Fixed submission:
# -*- coding: utf-8 -*-
n = int(input())
a = int(input())

if n % 500 <= a:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
n = int(input())
a = list(map(int(input().strip().split())))

a.sorted(reverse=True)

alice = 0
bob = 0
for i in range(n-1):
    if i % 2 is 0:
        alice = alice + int(a[i])
    else:
        bob = bob + int(a[i])
        
print(alice - bob)

Fixed submission:
n = int(input())
a = input().strip().split()
a = [ int(a[i]) for i in range(len(a)) ]

a.sort(reverse=True)

alice = 0
bob = 0
for i in range(n):
    if i % 2 is 0:
        alice = alice + int(a[i])
    else:
        bob = bob + int(a[i])
        
print(alice - bob)

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
n = int(input())
a = list(map(int(input().strip().split())))

a.sort(reverse=True)

alice = 0
bob = 0
for i in range(n-1):
    if i % 2 is 0:
        alice = alice + int(a[i])
    else:
        bob = bob + int(a[i])

ans = alice - bob
        
print(ans)

Fixed submission:
n = int(input())
a = input().strip().split()
a = [ int(a[i]) for i in range(len(a)) ]

a.sort(reverse=True)

alice = 0
bob = 0
for i in range(n):
    if i % 2 is 0:
        alice = alice + int(a[i])
    else:
        bob = bob + int(a[i])
        
print(alice - bob)

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
n = int(input())
a = list(map(int(input().strip().split())))

a.sort(reverse=True)

alice = 0
bob = 0
for i in range(n-1):
    if i % 2 is 0:
        alice += a[i]
    else:
        bob += a[i]

print(alice - bob)

Fixed submission:
n = int(input())
a = input().strip().split()
a = [ int(a[i]) for i in range(len(a)) ]

a.sort(reverse=True)

alice = 0
bob = 0
for i in range(n):
    if i % 2 is 0:
        alice = alice + int(a[i])
    else:
        bob = bob + int(a[i])
        
print(alice - bob)
Buggy python submission (verdict: Runtime Error):
n= int("".join(num.split()))

import math
if math.sqrt(n) % 1 == 0:
    print("Yes")
else:
    print("No")

Fixed submission:
n= int("".join(input().split()))

import math
if math.sqrt(n) % 1 == 0:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
n = int(input()strip())
p = [ list(map(int, input().split())) for i in range(n) ]
p.insert(0, [0,0,0])
ans = True

for i in range(n):
    time = p[i+1][0] - p[i][0]
    dist = abs(sum(p[i+1][1:]) - sum(p[i][1:]))

    if time % 2 != dist % 2 or dist > time:
        ans = False
        break

if ans: print("Yes")
else: print("No")

Fixed submission:
n = int(input().strip())
p = [ list(map(int, input().split())) for i in range(n) ]
p.insert(0, [0,0,0])

def check(n,p):
    for i in range(n):
        time = p[i+1][0] - p[i][0]
        dist = sum(p[i+1][1:]) - sum(p[i][1:])

        if time % 2 == 0 and dist % 2 == 0 or time % 2 == 1 and dist % 2 == 1:
            if -(time) <= dist <= time:
                pass
            else:
                return ans(1)
        else:
            return ans(1)

    return ans(0)

def ans(num):
    if num == 1: print("No")
    else: print("Yes")

check(n,p)
Buggy python submission (verdict: Runtime Error):
print(S[0] + (S.length()-2) + S[-1])

Fixed submission:
s = input()
print(s[0] + str(len(s)-2) + s[-1])
Buggy python submission (verdict: Runtime Error):
print('Even' if any(n % 2 == 0 for n in map(int, input().split()) else 'Odd')

Fixed submission:
print('Even' if any(n % 2 == 0 for n in map(int, input().split())) else 'Odd')
Buggy python submission (verdict: Runtime Error):
input_lines = input().split(" ")
n = int(input_lines[0])
m = int(input_lines[1])

if n == 1 and m == 1:
  	return 1
  
if n == 1 or m == 1:
	if n == 1:
		return m - 2
	else:
		return n - 2

return (m-2)*(n-2) 

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

count = 0
if m > 1 and n > 1:
  count = (m - 2)*(n - 2)
elif m == 1 and n > 1:
  count = n - 2
elif m > 1 and n == 1:
  count = m - 2
elif m == 1 and n == 1:
  count = 1
 
print(count)
Buggy python submission (verdict: Runtime Error):
def flip(B, m, n, M, N):
#  print(m,n)
  for mm in range(m-1,m+2):
    for nn in range(n-1,n+2):
#      print("mm=", mm, "nn=", nn)
      if 0<=mm and mm<M and 0<=nn and nn<N:
        if B[mm][nn] == 0:
          B[mm][nn] = 1
        else:
          B[mm][nn] = 0
#print(input().split())
MN=list(map(int, input().split()))
B = [[0 for i in range(MN[0])] for j in range(MN[1])]
for m in range(0,MN[0]):
  for n in range(0,MN[1]):
    flip(B, m, n, MN[0], MN[1])
c = 0
for m in range(0,MN[0]):
  for n in range(0,MN[1]):
    c += B[m][n]
#print(B)
print(c)

Fixed submission:
MN=list(map(int, input().split()))
M = MN[0]
N = MN[1]
if N == 1:
  N = MN[0]
  M = MN[1]
if M == 1:
  if N == 1:
    c = 1
  elif N == 2:
    c = 0
  else:
    c = N - 2
else:
  c = (M - 2)*(N - 2)
print(c)

Buggy python submission (verdict: Runtime Error):
def flip(B, m, n, M, N):
#  print(m,n)
  for mm in range(m-1,m+2):
    for nn in range(n-1,n+2):
      print("mm=", mm, "nn=", nn)
      if 0<=mm and mm<M and 0<=nn and nn<N:
        if B[mm][nn] == 0:
          B[mm][nn] = 1
        else:
          B[mm][nn] = 0
#print(input().split())
MN=list(map(int, input().split()))
B = [[0 for i in range(MN[0])] for j in range(MN[1])]
for m in range(0,MN[0]):
  for n in range(0,MN[1]):
    flip(B, m, n, MN[0], MN[1])
c = 0
for m in range(0,MN[0]):
  for n in range(0,MN[1]):
    c += B[m][n]
#print(B)
print(c)

Fixed submission:
MN=list(map(int, input().split()))
M = MN[0]
N = MN[1]
if N == 1:
  N = MN[0]
  M = MN[1]
if M == 1:
  if N == 1:
    c = 1
  elif N == 2:
    c = 0
  else:
    c = N - 2
else:
  c = (M - 2)*(N - 2)
print(c)
Buggy python submission (verdict: Runtime Error):
input()
a = list(map(int, input().split()))
a.sort(reversed=True)
print(sum(a[::2]) - sum(a[1::2]))

Fixed submission:
input()
a = list(map(int, input().split()))
a.sort(reverse=True)
print(sum(a[::2]) - sum(a[1::2]))
Buggy python submission (verdict: Runtime Error):
N = input()
a = []
for i in range(N):
    a.append(input())
a= list(set(a))
a.sort()
print len(a)

Fixed submission:
input_line1 = raw_input()
str_list = list(input_line1)
str_list[3]="8"
str_changed = "".join(str_list)
print(str_changed)
Buggy python submission (verdict: Runtime Error):
x = (input().count(1))
print(x)

Fixed submission:
x = (input().count('1'))
print(x)

Buggy python submission (verdict: Runtime Error):
x = int(input().count(1))
print(x)

Fixed submission:
x = (input().count('1'))
print(x)
Buggy python submission (verdict: Runtime Error):
s = input()$
return int(s)//3$


Fixed submission:
s = input()
print(int(s)//3)

Buggy python submission (verdict: Runtime Error):
n = int(input())
items = set(input().split())
results = {3: 'Three', 4: 'Four'}
if len(items) in results:
    print(results[len(items)])


Fixed submission:
print(int(input())//3)

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
N = int(input())
print int(N/3)

Fixed submission:
# -*- coding: utf-8 -*-
N = int(input())
print (int(N/3))

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
N = input()
print (N/3)

Fixed submission:
# -*- coding: utf-8 -*-
N = int(input())
print (int(N/3))

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
N = input()
print N/3

Fixed submission:
# -*- coding: utf-8 -*-
N = int(input())
print (int(N/3))

Buggy python submission (verdict: Runtime Error):
int x
raw_input(x)
int y = x%3
print(y)

Fixed submission:
x = int(input())
y = int(x/3)
print(y)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=[]
for i in range(N):
    a=int(input())
    if a not in A:
        A.append(a)
    else:
        A.remove(a)
print(len(A))

Fixed submission:
N=int(input())
A=set()
for i in range(N):
    a=int(input())
    if a not in A:
        A.add(a)
    else:
        A.remove(a)
print(len(A))
Buggy python submission (verdict: Runtime Error):
N=int(input())
T=[]
for i in range(N):
    T.append(int(input()))
import math
def lcm(a,b):
    return a*b//math.gcd(a,b)
if N==1:
    print(T[0])
elif N==2:
    print(lcm(T[0],T[1]))
else:
    l=[T[0]]
    for i in range(N-1):
      l.append(lcm(l[i],T[i+1]))
    print(l[-1])

Fixed submission:
N=int(input())
T=[]
for i in range(N):
    T.append(int(input()))
def gcd(a,b):
    if b>a:
        a,b=b,a
    while b>0:
        a,b=b,a%b
    return a
def lcm(a,b):
    return a*b//gcd(a,b)
if N==1:
    print(T[0])
elif N==2:
    print(lcm(T[0],T[1]))
else:
    l=[T[0]]
    for i in range(N-1):
      l.append(lcm(l[i],T[i+1]))
    print(l[-1])
Buggy python submission (verdict: Time Limit Exceeded):
N,M=map(int,input().split())
a=[]
b=[]
e=[]
f=[]
g=0
for i in range(M):
    c,d = map(int,input().split())
    a.append(c)
    b.append(d)
for j in range(M):
    if b[j]!=N:
        if a[j]!=1:
            pass
        else:
            e.append(b[j])
    else:
        f.append(a[j])
if (len(e)==0) or (len(f)==0):
    print('IMPOSSIBLE')
else:
    for l in range(len(e)):
      if e[l] in f:
        g += 1
        break
      else:
        pass
    if g>0:
      print('POSSIBLE')
    else:
      print('IMPOSSIBLE')

Fixed submission:
N,M=map(int,input().split())
island=[[] for i in range(N)]
for j in range(M):
    c,d=map(int,input().split())
    island[d-1].append(c)
    island[c-1].append(d)
f = 0
for k in range(N):
    if 1 in island[k]:
        if N in island[k]:
            f += 1
            break
        else:
            pass
    else:
        pass
if f>0:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')

Buggy python submission (verdict: Time Limit Exceeded):
N,M=map(int,input().split())
a=[]
b=[]
flag=0
for i in range(M):
    c,d = map(int,input().split())
    a.append(c)
    b.append(d)
for j in range(M):
    for k in range(M):
        if (b[j]==a[k]) and (a[j]==1) and (b[k]==N):
            flag += 1
        else:
            pass
if flag>0:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')

Fixed submission:
N,M=map(int,input().split())
island=[[] for i in range(N)]
for j in range(M):
    c,d=map(int,input().split())
    island[d-1].append(c)
    island[c-1].append(d)
f = 0
for k in range(N):
    if 1 in island[k]:
        if N in island[k]:
            f += 1
            break
        else:
            pass
    else:
        pass
if f>0:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')

Buggy python submission (verdict: Time Limit Exceeded):
N,M=map(int,input().split())
a=[]
b=[]
flag=0
for i in range(M):
    c,d = map(int,input().split())
    a.append(c)
    b.append(d)
for j in range(M):
    if a[j]==1:
        for k in range(M):
            if a[k]==b[j]:
                if b[k]==N:
                    flag += 1
                else:
                    pass
            else:
                pass
    else:
        pass
if flag>0:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')

Fixed submission:
N,M=map(int,input().split())
island=[[] for i in range(N)]
for j in range(M):
    c,d=map(int,input().split())
    island[d-1].append(c)
    island[c-1].append(d)
f = 0
for k in range(N):
    if 1 in island[k]:
        if N in island[k]:
            f += 1
            break
        else:
            pass
    else:
        pass
if f>0:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
b =[]
for i in range(1,n+1):
 if (n%2)==(i%2):
    b.insert(0,a[i-1])
 else:
    b.append(a[i-1])
print(' '.join(map(str,b)))

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
o =a[::2]
e =a[1::2]
if len(a)%2==0:
    ans = e[::-1]+o
elif len(a)==1:
    ans = a
else:
    ans = o[::-1]+e
print(' '.join(map(str,ans)))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
b =[]
for i in range(1,n+1):
    b.append(a[i-1])
    b = b[::-1]
print(' '.join(map(str,b)))


Fixed submission:
n = int(input())
a = list(map(int,input().split()))
o =a[::2]
e =a[1::2]
if len(a)%2==0:
    ans = e[::-1]+o
elif len(a)==1:
    ans = a
else:
    ans = o[::-1]+e
print(' '.join(map(str,ans)))
Buggy python submission (verdict: Runtime Error):
A, op, B = input().split()
if op == "+" :
   input (int(A) + int(B))
if op == "-" :
   input (int(A) - int(B))
input()

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):
ip = input()

ans = ip / 3
print(int(ans))

Fixed submission:
ip = int(input())

ans = ip / 3
print(int(ans))

Buggy python submission (verdict: Runtime Error):
def main():
    N = input()
    S = input().strip().split()

    if len(set(S)) == 3:
        return 'Three'
    else:
        return 'Four'
    
if __name__ == '__main__':
    print(main())

Fixed submission:
def main():
    N = int(input().strip())
    ret = N // 3
    return ret
if __name__ == '__main__':
    print(main())
Buggy python submission (verdict: Runtime Error):
N = int(raw_input())
print(N/3)


Fixed submission:
N = int(input())
print(N/3)

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

N=sys.argv[0]
print(int(N/3)

Fixed submission:
N = int(input())
print(N/3)
Buggy python submission (verdict: Runtime Error):
import sys

#N=sys.argv[1]
#te=sys.argv[2:]

N=raw_input()
te=raw_input()

flaglist=[]
for i in range(len(te)):
    if te[i]=="P" or te[i]=="p":
        if te[i]  not in flaglist:
            flaglist.append(te[i])
    if te[i]=="W" or te[i]=="w":
        if te[i]  not in flaglist:
            flaglist.append(te[i])
    if te[i]=="G" or te[i]=="g":
        if te[i]  not in flaglist:
            flaglist.append(te[i])
    if te[i]=="Y" or te[i]=="y":
        if te[i]  not in flaglist:
            flaglist.append(te[i])
            
if len(flaglist)==3:
    print("Three")
elif len(flaglist)==4:
    print("Four")


Fixed submission:
import sys



N=raw_input()
te=raw_input()

flaglist=[]
for i in range(len(te)):
    if te[i]=="P" or te[i]=="p":
        if te[i]  not in flaglist:
            flaglist.append(te[i])
    if te[i]=="W" or te[i]=="w":
        if te[i]  not in flaglist:
            flaglist.append(te[i])
    if te[i]=="G" or te[i]=="g":
        if te[i]  not in flaglist:
            flaglist.append(te[i])
    if te[i]=="Y" or te[i]=="y":
        if te[i]  not in flaglist:
            flaglist.append(te[i])
            
if len(flaglist)==3:
    print("Three")
elif len(flaglist)==4:
    print("Four")

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

N=sys.argv[1]
te=sys.argv[2:]

flaglist=[]
for i in range(len(te)):
    if te[i]=="P" or te[i]=="p":
        if te[i]  not in flaglist:
            flaglist.append(te[i])
    if te[i]=="W" or te[i]=="w":
        if te[i]  not in flaglist:
            flaglist.append(te[i])
    if te[i]=="G" or te[i]=="g":
        if te[i]  not in flaglist:
            flaglist.append(te[i])
    if te[i]=="Y" or te[i]=="y":
        if te[i]  not in flaglist:
            flaglist.append(te[i])
            
if len(flaglist)==3:
    print("Three")
elif len(flaglist)==4:
    print("Four")


Fixed submission:
import sys



N=raw_input()
te=raw_input()

flaglist=[]
for i in range(len(te)):
    if te[i]=="P" or te[i]=="p":
        if te[i]  not in flaglist:
            flaglist.append(te[i])
    if te[i]=="W" or te[i]=="w":
        if te[i]  not in flaglist:
            flaglist.append(te[i])
    if te[i]=="G" or te[i]=="g":
        if te[i]  not in flaglist:
            flaglist.append(te[i])
    if te[i]=="Y" or te[i]=="y":
        if te[i]  not in flaglist:
            flaglist.append(te[i])
            
if len(flaglist)==3:
    print("Three")
elif len(flaglist)==4:
    print("Four")
Buggy python submission (verdict: Runtime Error):
print(int(input()/3))

Fixed submission:
print(int(int(input())/3))

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

def comb1(n, r):
    if n == 0 or r == 0: return 1
    return comb1(n, r-1) * (n-r+1) / r

a = int(input())
# スペース区切りの整数の入力
m_members = []
a_members = []
r_members = []
c_members = []
h_members = []

for i in range(a):
    member = input()
    if(member[0:1] == 'M'):
        m_members.append(member)
    elif(member[0:1] == 'A'):
        a_members.append(member)
    elif(member[0:1] == 'R'):
        r_members.append(member)
    elif(member[0:1] == 'C'):
        c_members.append(member)
    elif(member[0:1] == 'H'):
        h_members.append(member)

member_info = []
count = 0
result = 0

if(len(m_members) != 0):
    member_info.append(len(m_members))
    count += 1
if(len(a_members) != 0):
    member_info.append(len(a_members))
    count += 1
if(len(r_members) != 0):
    member_info.append(len(r_members))
    count += 1
if(len(c_members) != 0):
    member_info.append(len(c_members))
    count += 1
if(len(h_members) != 0):
    member_info.append(len(h_members))
    count += 1

if(count >= 3):
    for i in (list(itertools.combinations(member_info, 3))):
        result += i[0] * i[1] * i[2]
    print(result)
else:
    print(0)


Fixed submission:
# -*- coding: utf-8 -*-
# 整数の入力
a = int(input())
# 出力
print(int(a/3))

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
a = int(input())
# スペース区切りの整数の入力
members = input().split()
a = []
count = 0

for member in members:
    if(member not in a):
        a.append(member)
        count += 1
if(count == 3):
    print("Three")
elif(count == 4):
    print("Four")


Fixed submission:
# -*- coding: utf-8 -*-
# 整数の入力
a = int(input())
# 出力
print(int(a/3))

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
a = int(input())
# スペース区切りの整数の入力
members = input().split()
a = []
count = 0

for member in members:
    if(member not in a):
        a.append(member)
        count += 1
if(count == 3):
    print("Three")
elif(count == 4):
    print("Four")


Fixed submission:
# -*- coding: utf-8 -*-
# 整数の入力
a = int(input())
# 出力
print(int(a/3))
Buggy python submission (verdict: Runtime Error):
import sys


def main(lines):
    s, t = lines.split('\n')

    s_ = ''
    for i in sorted(s):
        s_ += i

    t_ = ''
    for i in sorted(t, reverse=True):
        t_ += i

    if s_ < t_:
        return 'Yes'
    else:
        return 'No'


if __name__ == '__main__':
    lines_ = sys.stdin.readlines()
    ret = main(lines_)
    print(ret)

Fixed submission:
import sys


def main(s, t):
    s_ = ''
    for i in sorted(s):
        s_ += i

    t_ = ''
    for i in sorted(t, reverse=True):
        t_ += i

    if s_ < t_:
        return 'Yes'
    else:
        return 'No'


if __name__ == '__main__':
    _s = input()
    _t = input()
    ret = main(_s, _t)
    print(ret)
Buggy python submission (verdict: Runtime Error):
 a = input()

 ret = ""
 cnt = 0
 for i in a:
     if i == "B":
         ret = ret[:-1:]
     else:
         ret += i
 print(ret)


Fixed submission:
a = input()

ret = ""
cnt = 0
for i in a:
    if i == "B":
        ret = ret[:-1:]
    else:
        ret += i
print(ret)
Buggy python submission (verdict: Runtime Error):
N, L = map(int, input().split())
S = ["" for i in range(N)]
for i in range(N):
    S[i] = input()

S.sort()
result = ""
for i in range(N):
    result += S[i]
print(result)

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

if a == [5,5,7]:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
3 3
dxx
axx
cxx

Fixed submission:
N, L = map(int, input().split())
S = ["" for i in range(N)]
for i in range(N):
    S[i] = input()

S.sort()
result = ""
for i in range(N):
    result += S[i]
print(result)
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

X, Y = map(int, raw_input().split())
cnt = 0
num = X
while num <= Y:
    cnt += 1
    num = num*2

print(cnt)


Fixed submission:
# -*- coding: utf-8 -*-

X, Y = map(int, input().split())
cnt = 0
num = X
while num <= Y:
    cnt += 1
    num = num*2

print(cnt)

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

import math
X, Y = map(int, raw_input().split())
cnt = 0
num = X
while num <= Y:
    cnt += 1
    num = num*2

print(cnt)


Fixed submission:
# -*- coding: utf-8 -*-

X, Y = map(int, input().split())
cnt = 0
num = X
while num <= Y:
    cnt += 1
    num = num*2

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

S = input()
n = len(S)
T = []

for i in range(len(S)-1):
    if S[i] != S[i+1]:
        t = max(i+1, n-i-1)
        T.append(t)
print(min(T))


Fixed submission:
# -*- coding: utf-8 -*-

S = input()
n = len(S)
T = []

for i in range(len(S)-1):
    if S[i] != S[i+1]:
        t = max(i+1, n-i-1)
        T.append(t)
if len(T) == 0:
    print(n)
else:
    print(min(T))