qyliang/CodeNanoFix huggingface dataset:
Buggy code:
s = [1 if si == 'o' else 0 for si in list(input())]
t0 = [[1, 1], [1, 0], [0, 1], [0, 0]]
for ti in t0:
    flag = True
    for i in range(1, n - 1):
        if ti[i] * (1 - s[i]) or (1 - ti[i]) * s[i]:
            ti.append(1 - ti[i - 1])
        else:
            ti.append(ti[i - 1])
    for i in range(2):
        if ti[i - 1]:
            if (s[i - 1] and not ti[i - 2] == ti[i]) or (1 - s[i - 1] and ti[i - 2] == ti[i]):
                flag = False
        else:
            if (s[i - 1] and ti[i - 2] == ti[i]) or (1 - s[i - 1] and not ti[i - 2] == ti[i]):
                flag = False
    if flag:
        ans = ['S' if x else 'W' for x in ti]
        print(''.join(ans))
        exit()
print(-1)

Fixed code:
n = int(input())
s = [1 if si == 'o' else 0 for si in list(input())]
t0 = [[1, 1], [1, 0], [0, 1], [0, 0]]
for ti in t0:
    flag = True
    for i in range(1, n - 1):
        if ti[i] * (1 - s[i]) or (1 - ti[i]) * s[i]:
            ti.append(1 - ti[i - 1])
        else:
            ti.append(ti[i - 1])
    for i in range(2):
        if ti[i - 1]:
            if (s[i - 1] and not ti[i - 2] == ti[i]) or (1 - s[i - 1] and ti[i - 2] == ti[i]):
                flag = False
        else:
            if (s[i - 1] and ti[i - 2] == ti[i]) or (1 - s[i - 1] and not ti[i - 2] == ti[i]):
                flag = False
    if flag:
        ans = ['S' if x else 'W' for x in ti]
        print(''.join(ans))
        exit()
print(-1)
Buggy code:
N=int(input())
s=input()
assum=["SS","SW","WS","WW"]
for item in assum:
  t=item
  for i in range(1,N-1):
    if ((s[i]=="o") and (t[i]=="S")) or ((s[i]=="x") and (t[i]=="W")):
      t+=t[i-1]
    else:
      if t[i-1]=="S":
        t+="W"
      else:
        t+="S"
  if (t[N-2]==t[0] and ((s[N-1]=="o" and t[N-1]=="S") or (s[N-1]=="x" and t[N-1]=="W"))) or (t[N-2]!=t[0] and ((s[N-1]=="o" and t[N-1]=="W") or (s[N-1]=="x" and t[N-1]=="S"))):
    if (t[N-1]==t[1] and ((s[1]=="o" and t[1]=="S") or (s[1]=="x" and t[1]=="W"))) or (t[N-1]!=t[1] and ((s[1]=="o" and t[1]=="W") or (s[1]=="x" and t[1]=="S"))):
      print(t)
      break
else:
  print(-1)

Fixed code:
N=int(input())
s=input()
assum=["SS","SW","WS","WW"]
for item in assum:
  t=item
  for i in range(1,N-1):
    if ((s[i]=="o") and (t[i]=="S")) or ((s[i]=="x") and (t[i]=="W")):
      t+=t[i-1]
    else:
      if t[i-1]=="S":
        t+="W"
      else:
        t+="S"
  if (t[N-2]==t[0] and ((s[N-1]=="o" and t[N-1]=="S") or (s[N-1]=="x" and t[N-1]=="W"))) or (t[N-2]!=t[0] and ((s[N-1]=="o" and t[N-1]=="W") or (s[N-1]=="x" and t[N-1]=="S"))):
    if (t[N-1]==t[1] and ((s[0]=="o" and t[0]=="S") or (s[0]=="x" and t[0]=="W"))) or (t[N-1]!=t[1] and ((s[0]=="o" and t[0]=="W") or (s[0]=="x" and t[0]=="S"))):
      print(t)
      break
else:
  print(-1)
Buggy code:
!/usr/bin/python3
from itertools import product

def solve():
	N = int(input())
	S = [0 if i == 'o' else 1 for i in input()]

	for i, j in product(range(2), repeat=2):
		pattern = [i, j] + [0] * (N - 2) 
		for k in range(2, N):
			pattern[k] = (pattern[k - 1] + pattern[k - 2] + S[k] ) % 2
		if S[-1] != (pattern[-2] + pattern[-1] + pattern[0]) % 2 : 
			continue
		if S[0] != (pattern[-1] + pattern[0] + pattern[1]) % 2 :
			continue 	
		answer = [ 'S' if pattern[k] == 0 else 'W' for k in range(N)]
		print(''.join(answer))
		return None;
	print(-1);

if __name__ == '__main__':
	solve()

Fixed code:
from itertools import product
 
def solve():
	N = int(input())
	S = [0 if i == 'o' else 1 for i in input()]
 
	for i, j in product(range(2), repeat=2):
		pattern = [i, j] + [0] * (N - 2) 
		for k in range(2, N):
			pattern[k] = (pattern[k - 1] + pattern[k - 2] + S[k-1] ) % 2
		if S[-1] != (pattern[-2] + pattern[-1] + pattern[0]) % 2 : 
			continue
		if S[0] != (pattern[-1] + pattern[0] + pattern[1]) % 2 :
			continue 	
		answer = [ 'S' if pattern[k] == 0 else 'W' for k in range(N)]
		print(''.join(answer))
		return None
	print(-1)
 
if __name__ == '__main__':
	solve()
Buggy code:
def solve():
    N = int(input())
    S = [0 if i == 'o' else 1 for i in input()]
    
    for i, j in product(range(2), repeat=2):
        pat = [i, j] + [0]*(N - 2)
        for k in range(2, N):
            pat[k] = (S[k - 1] - (pat[k - 1] + pat[k - 2])) % 2

        if S[-1] != (pat[0] + pat[-1] + pat[-2]) % 2:
            continue
        if S[0] != (pat[1] + pat[0] + pat[-1]) % 2:
            continue

        ans = ['S' if pat[k] == 0 else 'W' for k in range(N)]
        print(''.join(ans))
        return None

    print(-1)

if __name__ == '__main__':
    solve()

Fixed code:
from itertools import product

def solve():
    N = int(input())
    S = [0 if i == 'o' else 1 for i in input()]
    
    for i, j in product(range(2), repeat=2):
        pat = [i, j] + [0]*(N - 2)
        for k in range(2, N):
            pat[k] = (S[k - 1] - (pat[k - 1] + pat[k - 2])) % 2

        if S[-1] != (pat[0] + pat[-1] + pat[-2]) % 2:
            continue
        if S[0] != (pat[1] + pat[0] + pat[-1]) % 2:
            continue

        ans = ['S' if pat[k] == 0 else 'W' for k in range(N)]
        print(''.join(ans))
        return None

    print(-1)

if __name__ == '__main__':
    solve()
Buggy code:
n = int(input())
s = input()

ans = ["SS", "SW", "WS", "WW"]

for i in range(4):
    for j in range(1, n):
        if s[j] == "o" and ans[i][j] == "S":
            ans[i] += ans[i][j-1]
        elif s[j] == "o" and ans[i][j] == "W":
            ans[i] += "W" if ans[i][j-1] == "S" else "S"
        elif s[j] == "x" and ans[i][j] == "S":
            ans[i] += "W" if ans[i][j-1] == "S" else "S"
        else:
            ans[i] += ans[i][j - 1]
            
    if ans[i][0] == ans[i][n]:
        if ans[i][n-1] == ans[i][1] and ((s[0] == "o" and ans[0] == "S") or (s[0] == "x" and ans[0] == "W")):
            print(ans[i][:-1])
            break
        if ans[i][n-1] != ans[i][1] and ((s[0] == "o" and ans[0] == "W") or (s[0] == "x" and ans[0] == "S")):
            print(ans[i][:-1])
            break
else:
    print(-1)


Fixed code:
n = int(input())
s = input()

ans = ["SS", "SW", "WS", "WW"]

for i in range(4):
    for j in range(1, n):
        if s[j] == "o" and ans[i][j] == "S":
            ans[i] += ans[i][j-1]
        elif s[j] == "o" and ans[i][j] == "W":
            ans[i] += "W" if ans[i][j-1] == "S" else "S"
        elif s[j] == "x" and ans[i][j] == "S":
            ans[i] += "W" if ans[i][j-1] == "S" else "S"
        else:
            ans[i] += ans[i][j - 1]

    if ans[i][0] == ans[i][n]:
        if ans[i][n-1] == ans[i][1] and ((s[0] == "o" and ans[i][0] == "S") or (s[0] == "x" and ans[i][0] == "W")):
            print(ans[i][:-1])
            break
        if ans[i][n-1] != ans[i][1] and ((s[0] == "o" and ans[i][0] == "W") or (s[0] == "x" and ans[i][0] == "S")):
            print(ans[i][:-1])
            break
else:
    print(-1)
Buggy code:
def check(listx,s):
	num = (listx[-2]+listx[1])%2
	if num!=listx[0] and s[0]=="o": return True
	elif num==listx[0] and s[0]=="x": return True
	else: return False
n = int(input())
s = input()
x,flag,ans = [[1,1],[1,0],[0,1],[1,0]],False,""
for i in range(4):
	for j in range(1,n):
		if (s[j]=="o" and x[i][-1]==1) or (s[j]=="x" and x[i][-1]==0): x[i].append(x[i][-2])
		else: x[i].append(1-x[i][-2])
	print(x[i])
	if x[i][0]==x[i][-1] and check(x[i],s):
		flag = True
		break
if flag:
	for k in x[i][:n]:
		if k==1: ans+="S"
		else: ans+="W"
	print(ans)
else: print(-1)

Fixed code:
def check(listx,s):
	num = (listx[-2]+listx[1])%2
	if num!=listx[0] and s[0]=="o": return True
	elif num==listx[0] and s[0]=="x": return True
	else: return False
n = int(input())
s = input()
x,flag,ans = [[1,1],[1,0],[0,1],[0,0]],False,""
for i in range(4):
	for j in range(1,n):
		if (s[j]=="o" and x[i][-1]==1) or (s[j]=="x" and x[i][-1]==0): x[i].append(x[i][-2])
		else: x[i].append(1-x[i][-2])
	if x[i][0]==x[i][-1] and check(x[i],s):
		flag = True
		break
if flag:
	for k in x[i][:n]:
		if k==1: ans+="S"
		else: ans+="W"
	print(ans)
else: print(-1)
Buggy code:
n =int(input())
s = input()
cir = ['']*n
judge = ''
def convertSW(x):
  if x == 'S':
    return 'W'
  elif x == 'W':
    return 'S'
for i in range(4):
  if i == 0:
    cir[0],cir[1] = 'S','S'
  if i == 1:
    cir[0],cir[1] = 'S','W'
  if i == 2:
    cir[0],cir[1] = 'W','W'
  else:
    cir[0],cir[1] = 'W','S'
  if s[0] == 'o' and cir[0] == 'S' or s[0] == 'x' and cir[0] == 'W':
    judge = cir[1]
  else:
    judge = convertSW(cir[1])    
  for j in range(2,n):
    if s[j-1] == 'o' and cir[j-1] == 'S' or s[j-1] == 'x' and cir[j-1] == 'W':
      cir[j] = cir[j-2]
    else:
      cir[j] = convertSW(cir[j-2])
  if (s[-1] == 'o' and cir[-1] == 'S') or (s[-1] == 'x' and cir[-1] == 'W'):
    if cir[0] == cir[-2]:
      print(''.join(cir))
      exit()
  else:
    if cir[0] == convertSW(cir[-2]):
      print(''.join(cir))
      exit()
print(-1)

Fixed code:
n =int(input())
s = input()
cir = ['']*n
judge = ''
def convertSW(x):
  if x == 'S':
    return 'W'
  elif x == 'W':
    return 'S'
for i in range(4):
  if i == 0:
    cir[0],cir[1] = 'S','S'
  elif i == 1:
    cir[0],cir[1] = 'S','W'
  elif i == 2:
    cir[0],cir[1] = 'W','W'
  else:
    cir[0],cir[1] = 'W','S'
  if (s[0] == 'o' and cir[0] == 'S') or (s[0] == 'x' and cir[0] == 'W'):
    judge = cir[1]
  else:
    judge = convertSW(cir[1])
  for j in range(2,n):
    if (s[j-1] == 'o' and cir[j-1] == 'S') or (s[j-1] == 'x' and cir[j-1] == 'W'):
      cir[j] = cir[j-2]
    else:
      cir[j] = convertSW(cir[j-2])
  if (s[-1] == 'o' and cir[-1] == 'S') or (s[-1] == 'x' and cir[-1] == 'W'):
    if (cir[0] == cir[-2]) and (judge == cir[-1]):
      print(''.join(cir))
      exit()
  else:
    if cir[0] == convertSW(cir[-2]) and (judge == cir[-1]):
      print(''.join(cir))
      exit()
print(-1)
Buggy code:
def judge():
    for i in range(1, n):
        before = list[i-1]
        l = s[i]
        print(i, l)
        if l == 'o':
            if list[i] == 'S':
                if before == 'S':
                    list.append('S')
                else:
                    list.append('W')
            else:
                if before == 'S':
                    list.append('W')
                else:
                    list.append('S')
        else:
            if list[i] == 'S':
                if before == 'S':
                    list.append('W')
                else:
                    list.append('S')
            else:
                if before == 'S':
                    list.append('S')
                else:
                    list.append('W')
    if list[0] == list[n]:
        if s[0] == 'o' and list[1] == list[n-1] or s[0] == 'x' and list[1] != list[n-1]:
            list.pop()
            print("".join(list))
            exit()

n = int(input())
s = input()

list = ['S', 'S']
judge()
list.clear()
list = ['S', 'W']
judge()
list.clear()
list = ['W', 'S']
judge()
list.clear()
list = ['W', 'W']
judge()
list.clear()
print('-1')

Fixed code:
def judge():
    for i in range(1, n):
        before = list[i-1]
        l = s[i]
        if l == 'o':
            if list[i] == 'S':
                if before == 'S':
                    list.append('S')
                else:
                    list.append('W')
            else:
                if before == 'S':
                    list.append('W')
                else:
                    list.append('S')
        else:
            if list[i] == 'S':
                if before == 'S':
                    list.append('W')
                else:
                    list.append('S')
            else:
                if before == 'S':
                    list.append('S')
                else:
                    list.append('W')
    if list[0] == list[n]:
        if list[0] == 'S':
            if s[0] == 'o' and list[1] == list[n-1] or s[0] == 'x' and list[1] != list[n-1]:
                list.pop()
                print("".join(list))
                exit()
        elif list[0] == 'W':
            if s[0] == 'x' and list[1] == list[n-1] or s[0] == 'o' and list[1] != list[n-1]:
                list.pop()
                print("".join(list))
                exit()

n = int(input())
s = input()

list = ['S', 'S']
judge()
list.clear()
list = ['S', 'W']
judge()
list.clear()
list = ['W', 'S']
judge()
list.clear()
list = ['W', 'W']
judge()
list.clear()
print('-1')
Buggy code:
n = int(input())
s = input()

a = False
b = False

sw = [None] * n

sw[0] = False
sw[1] = False

def next(s,sw,i,j):
    if s[i] == 'o':
        return not (sw[j] ^ sw[i])
    else:
        return sw[j] ^ sw[i]

def printsw(sw,n):
    s = ''
    for i in range(n):
        if sw[i]:
            s += 'S'
        else:
            s += 'W'
    print(s)

flag = True

for j in range(4):
    for i in range(2,n):
        sw[i] = next(s,sw,i-2,i-1)

    zero = next(s,sw,n-2,n-1)
    one = next(s,sw,n-1,0)
    if zero == sw[0]:
        if one == sw[1]:
            printsw(sw,n)
            flag = False
            break

    sw[0] = not sw[0]
    if j == 1:
        sw[1] = True

if flag:
    print(-1)


Fixed code:
n = int(input())
s = input()

a = False
b = False

sw = [None] * n

sw[0] = True
sw[1] = True

def next(s,sw,j,i):
    if s[i] == 'o':
        return not (sw[j] ^ sw[i])
    else:
        return sw[j] ^ sw[i]

def printsw(sw,n):
    s = ''
    for i in range(n):
        if sw[i]:
            s += 'S'
        else:
            s += 'W'
    print(s)

flag = True

for j in range(4):
    for i in range(2,n):
        sw[i] = next(s,sw,i-2,i-1)

    zero = next(s,sw,n-2,n-1)
    one = next(s,sw,n-1,0)
    if zero == sw[0]:
        if one == sw[1]:
            printsw(sw,n)
            flag = False
            break

    sw[0] = not sw[0]
    if j == 1:
        sw[1] = False

if flag:
    print(-1)
Buggy code:
import sys

def SorW(i):
    if t[i] == 'S' and t[i - 1] == 'S':
        if s[i] == 'o':
            a = 'S'
        else:
            a = 'W'
    elif t[i] == 'S' and t[i - 1] == 'W':
        if s[i] == 'o':
            a = 'W'
        else:
            a = 'S'
    elif t[i] == 'W' and t[i - 1] == 'S':
        if s[i] == 'o':
            a = 'W'
        else:
            a = 'S'
    else:
        if s[i] == 'o':
            a = 'S'
        else:
            a = 'W'
    return a

N = int(input())
s = str(input())

for t in [['S', 'S'], ['S', 'W'], ['W', 'W'], ['W', 'S']]:
    for i in range(1, N):
        t.append(SorW(i))
        if i == N - 1:
            if t[0] == t[N - 1] and t[1] == SorW(0):
                del t[N - 1]
                print(t)
                sys.exit()
print('-1')


Fixed code:
import sys

def SorW(i):
    if i == 0:
        j = N - 1
    else:
        j = i - 1
    if t[i] == 'S' and t[j] == 'S':
        if s[i] == 'o':
            a = 'S'
        else:
            a = 'W'
    elif t[i] == 'S' and t[j] == 'W':
        if s[i] == 'o':
            a = 'W'
        else:
            a = 'S'
    elif t[i] == 'W' and t[j] == 'W':
        if s[i] == 'o':
            a = 'S'
        else:
            a = 'W'
    else:
        if s[i] == 'o':
            a = 'W'
        else:
            a = 'S'
    return a

N = int(input())
s = str(input())

for t in [['S', 'S'], ['S', 'W'], ['W', 'W'], ['W', 'S']]:
    for i in range(1, N):
        t.append(SorW(i))
    if t[0] == t[N] and t[1] == SorW(0):
        del t[N]
        print(''.join(t))
        sys.exit()
print('-1')
Buggy code:
import itertools
N = int(input())
s = list(map(lambda x: True if x == "o" else False, list(input())))

# N = 6
# s = "ooxoox"
# N = 3
# s = "oox"
s = [True, True, False]

def hantei(N,s):
    f = lambda x,y: not(x^y)
    for onetwo in itertools.product((True, False), (True, False)):
        res = {}
        for n in range(N):
            if n == 0:
                res[n] = onetwo[0]
            elif n == 1:
                res[n] = onetwo[1]
            else:
                res[n] = f(res[n-2], f(res[n-1], s[n-1]))
        # check s[0]
        if not ((res[1] == res[N-1]) ^ res[0]) == s[0]:
            if not ((res[0] == res[N-2]) ^ res[N-1]) == s[N-1]:
                print(''.join(map(lambda x: "S" if x == 0 else "W", res.values())))
                return True

    return False

if not hantei(N, s):
    print(-1)
    


Fixed code:
import itertools
N = int(input())
s = list(map(lambda x: True if x == "o" else False, list(input())))

f = lambda x,y: not(x^y)

def hantei(N,s):
    for onetwo in itertools.product((True, False), (True, False)):
        res = {}
        for n in range(N):
            if n == 0:
                res[n] = onetwo[0]
            elif n == 1:
                res[n] = onetwo[1]
            else:
                res[n] = f(res[n-2], f(res[n-1], s[n-1]))
        # check s[0]
        if not ((res[1] == res[N-1]) ^ res[0]) == s[0]:
            if not ((res[0] == res[N-2]) ^ res[N-1]) == s[N-1]:
                print(''.join(map(lambda x: "S" if x == True else "W", res.values())))
                return True

    return False

if not hantei(N, s):
    print(-1)
Buggy code:
N = int(input())
t = list(input())
Ans = ['n' for _ in t]

def judge(prevSW, SW, ox):
    if SW == 'S':
        if ox == 'o':
            return prevSW
        else:
            if prevSW == 'S':
                return 'W'
            else: return 'S'
    elif SW == 'W':
        if ox == 'x':
            return prevSW
        else:
            if prevSW == 'S':
                return 'W'
            else: return 'S'

def decideorder(startSW):
    Ans[1] = startSW
    for i in range(2,N):
        Ans[i] = judge(Ans[i-2], Ans[i-1], t[i-1])


Ans[0] = 'S'
decideorder('S')
if judge(Ans[-1], Ans[0], t[0]) is Ans[0]:
    print("".join(Ans))
else:
    decideorder('W')
    if judge(Ans[-1], Ans[0], t[0]) is Ans[0]:
        print("".join(Ans))
    else:
        Ans[0] = 'W'
        decideorder('S')
        if judge(Ans[-1], Ans[0], t[0]) is Ans[0]:
            print("".join(Ans))
        else:
            decideorder('W')
            if judge(Ans[-1], Ans[0], t[0]) is Ans[0]:
                print("".join(Ans))


Fixed code:
N = int(input())
t = list(input())
Ans = ['n' for _ in t]
 
def judge(prevSW, SW, ox):
    if SW == 'S':
        if ox == 'o':
            return prevSW
        else:
            if prevSW == 'S':
                return 'W'
            else: return 'S'
    elif SW == 'W':
        if ox == 'x':
            return prevSW
        else:
            if prevSW == 'S':
                return 'W'
            else: return 'S'
 
def decideorder(startSW):
    Ans[1] = startSW
    for i in range(2,N):
        Ans[i] = judge(Ans[i-2], Ans[i-1], t[i-1])

def check():
    if judge(Ans[-2], Ans[-1], t[-1]) is Ans[0] and judge(Ans[-1], Ans[0], t[0]) is Ans[1]:
        return True
    else:
        return False

Ans[0] = 'S'
decideorder('S')
if check():
    print("".join(Ans))
else:
    decideorder('W')
    if check():
        print("".join(Ans))
    else:
        Ans[0] = 'W'
        decideorder('S')
        if check():
            print("".join(Ans))
        else:
            decideorder('W')
            if check():
                print("".join(Ans))
            else:
                print(-1)
Buggy code:
A,B = map(int,input().split())

if A == B:
    print('Drew')
elif A == 1:
    print('Alice')
elif B == 1:
    print('Bob')
elif A > B:
    print('Alice')
else:
    print('Bob')

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

if A == B:
    print('Draw')
elif A == 1:
    print('Alice')
elif B == 1:
    print('Bob')
elif A > B:
    print('Alice')
else:
    print('Bob')
Buggy code:
A, B =map(int, input().split())
if A==1:
    A=14
if B==1:
    A=14
print("Alice" if A>B else "Bob" if B<A else "Draw")

Fixed code:
A, B =map(int, input().split())
if A==1:
    A=14
if B==1:
    B=14
print("Alice" if A>B else "Bob" if B>A else "Draw")
Buggy code:
a, b = map(int, input().split()
if a == b:
  print("Draw")
elif a == 1 or a > b:
    print("Alice")
else:
    print("Bob")

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

if a==b:
  print('Draw')
elif b==1:
  print('Bob')
elif a==1 or a>b:
  print('Alice')
else:
  print('Bob')
Buggy code:
A, B = map(int, input().split())

if A == 1:
    A += 12
if B == 1:
    B += 12

if A > B:
    print('Alice')
elif A < B:
    print('Bob')
else:
    print('Draw')

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

if A == 1:
    A += 13
if B == 1:
    B += 13

if A > B:
    print('Alice')
elif A < B:
    print('Bob')
else:
    print('Draw')
Buggy code:
a ,b= map(int, input().split())
if a == 1:
    a +=13
if b == 1:
    b +=13
if a>b:
    print("Bob")
elif a == b:
    print("Draw")
else:print("Alice")


Fixed code:
a ,b= map(int, input().split())
if a == 1:
    a +=13
if b == 1:
    b +=13
if a<b:
    print("Bob")
elif a == b:
    print("Draw")
else:print("Alice")
Buggy code:
a, b = map(int,input().split())
a, b = a+13*(a<2),b+13*(a<2)
if a>b:
  print("Alice")
elif a<b:
  print("Bob")
else:
  print("Draw")


Fixed code:
a, b = map(int,input().split())
a, b = a+13*(a<2),b+13*(b<2)
if a>b:
  print("Alice")
elif a<b:
  print("Bob")
else:
  print("Draw")
Buggy code:
a,b=map(int,input().split())
if a==b:
  print('Draw')
elif a==1 or (a>b and B!=1):
  print('Alice')
else:
  print('Bob')

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

if a == b:
    print('Draw')
elif a > b and b != 1 or a == 1 :
    print('Alice')
else:
    print('Bob')
Buggy code:
a, b = list(map(int, input().split()))
if a == 1:
  a = 14
else:
  break
if b == 1:
  b = 14
else:
  break
if a > b:
  print('Alice')
elif a == b:
  print('Draw')
else:
  print('Bob')


Fixed code:
a, b = list(map(int, input().split()))
if a == 1:
  a = 14
else:
  a = a
if b == 1:
  b = 14
else:
  b = b
if a > b:
  print('Alice')
elif a == b:
  print('Draw')
else:
  print('Bob')
Buggy code:
import sys

input = sys.stdin.readline


def main():
    A, B = map(int, input().split())
    if A == B:
        print("Draw")
    elif A > B:
        print("Alice")
    else:
        print("Bob")


if __name__ == "__main__":
    main()


Fixed code:
import sys

input = sys.stdin.readline


def main():
    A, B = map(int, input().split())
    if A == 1:
        A = 14
    if B == 1:
        B = 14

    if A == B:
        print("Draw")
    elif A > B:
        print("Alice")
    else:
        print("Bob")


if __name__ == "__main__":
    main()
Buggy code:
a,b=(map(int,input().split())+13)%15;print('Alice' if a>b else 'Bob' if a<b else 'Draw)

Fixed code:
a,b=map(int,input().split())
a,b=(a+13)%15,(b+13)%15
print("Alice" if a>b else "Bob" if a<b else "Draw")
Buggy code:
a, b = map(int, input().split())

if a == 1 or a > b:
    print("Alice")
elif b == 1 or a < b:
    print("Bob")
else:
    print("Draw")

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

if a == b:
    print("Draw")
elif a == 1 or b == 1:
    if a == 1:
        print("Alice")
    else:
        print("Bob")
else:
    if a > b:
        print("Alice")
    elif a < b:
        print("Bob")
Buggy code:
lis=input().split()
a=int(lis[0])
b=int(lis[1])
if a=1:
    if b=1:
        print(Draw)
    else :
        print(Alice)
elif b=1:
    print(Bob)
else :
    if a>b:
        print(Alice)
    elif a=b:
        print(Draw)
    else :
        print(Bob)

Fixed code:
lis=input().split()
a=int(lis[0])
b=int(lis[1])
if a==1:
    if b==1:
        print("Draw")
    else :
        print("Alice")
elif b==1:
    print("Bob")
else :
    if a>b:
        print("Alice")
    elif a==b:
        print("Draw")
    else :
        print("Bob")
Buggy code:
A,B = map(int,input().split())
if A==1:
  A=100
if B==1:
  B=100

if A>B:
  print("Bob")
elif A<B:
  print("Alice")
else:
  print("Draw")

Fixed code:
A,B = map(int,input().split())
if A==1:
  A=100
if B==1:
  B=100

if A>B:
  print("Alice")
elif A<B:
  print("Bob")
else:
  print("Draw")
Buggy code:
#ABC055
a,b = map(lambda x:(int(x)-2)%13,input().split())
if a > b:
  print('Alice')
elif a == b:
  print('Bob')
else:
  print('Draw')

Fixed code:
#ABC055
a,b = map(lambda x:(int(x)-2)%13,input().split())
if a > b:
  print('Alice')
elif a == b:
  print('Draw')
else:
  print('Bob')
Buggy code:
a,b=map(int,input().split())

print("Alice" if a>b else "Bob" if a<b else "Draw" )

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

print("Draw" if a==b else "Alice" if a==1 else "Bob" if b==1 else "Alice" if a>b else "Bob" )