qyliang/CodeNanoFix huggingface dataset:
Buggy code:
def main():

    n,a,b=map(int,input().split())

    if abs(a-b) % 2 == 0:
        print(abs(a-b)//2)
        return
    left=0
    temp = max(a,b)
    left = temp - 1
    right = 0
    temp = min(a,b)
    right = n - temp
    ans = min(left,right)

    tempR=b-a
    mid1=(tempR-1)//2
    tempL=a+n-b
    mid2=(n-tempL)//2
    ans = min(ans,mid1,mid2)

    print(ans)
    return
if __name__=='__main__':
    main()


Fixed code:
def main():

    n,a,b=map(int,input().split())

    if abs(a-b) % 2 == 0:
        print(abs(a-b)//2)
        return
    left=0
    temp = max(a,b)
    left = temp - 1
    right = 0
    temp = min(a,b)
    right = n - temp
    ans = min(left,right)

    tempR=b-a
    mid1=10**19
    if tempR-1>0:
        mid1=(tempR-1)//2 + a
    tempL=a+n-b+1
    mid2=10**19
    if n-tempL > 0:
        mid2=(n-tempL)//2 + n-b+1
    ans = min(ans,mid1,mid2)


    print(ans)
    return
if __name__=='__main__':
    main()
Buggy code:
n, a, b = map(int, input().split())

ans = 0

if (b - a) % 2 == 0:
    ans = (b - a) // 2
else:
    first_move = (b - a) // 2
    p = (a + b) // 2
    second_move = min(p, n - p)
    ans = first_move + second_move
ans = min(ans, b - a, n - a)
print(ans)


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

ans = 0

if (b - a) % 2 == 0:
    ans = (b - a) // 2
else:
    first_move = min(a - 1, n - b)
    second_move = (b - a - 1) // 2 + 1
    ans = first_move + second_move

print(ans)
Buggy code:
n,a,b=map(int,input().split())
if abs(a-b)%2==0:
  print(abs(a-b)//2)
else:
  ma,mi=max(a,b),min(a,b)
  print(min(mi-a,n-ma))

Fixed code:
n,a,b=map(int,input().split())
if abs(a-b)%2==0:
  print(abs(a-b)//2)
else:
  ma,mi=max(a,b),min(a,b)
  print(min(mi-1,n-ma)+abs(a-b)//2+1)
Buggy code:
n, a, b = map(int, input().split())

d = b-a
d_nearest_side = min(a-1, n-b)
if d % 2 == 0:
    print(int(d/2))
else:
    move_side = (d-1)/2 + d_nearest_side
    print(int(move_side))


Fixed code:
n, a, b = map(int, input().split())
d = b-a
d_nearest_side = min(a-1, n-b)
if d % 2 == 0:
    print(d//2)
else:
    move_side = 1 + (d-1)//2 + d_nearest_side
    print(int(move_side))
Buggy code:
a = list(map(int,input().split()))
N = a[0]
A = a[1]
B = a[2]
ans = 0

print(N,A,B)

if(A == B):
  ans = 0

if (B - A) % 2 == 0:
  ans = (B + A) / 2
else:
  if (N - A) > (B - 1):
    ans = B - 1
  else:
    ans = N - A
  
print(ans)

Fixed code:
a = list(map(int,input().split()))
N = a[0]
A = a[1]
B = a[2]

if (B - A) % 2 == 0:
  ans = (B - A) // 2
else:
  if (N - A) > (B - 1):
    ans = A - 1
    A = 1
    B = B - ans
    ans = ans + 1
    B = B - 1
    ans = ((B - A) // 2) + ans
  else:
    ans = N - B
    B = N
    A = A + ans
    ans = ans + 1
    A = A + 1
    ans = ((B - A) // 2) + ans
  
print(ans)
Buggy code:
N,A,B=map(int,input().split())
ans=0
if (B-A)%2==0:
	ans=(B-A)//2
	print(ans)
else:
	if A < N-B:
		print(B-1)
	else:
		print(N-A)

Fixed code:
N,A,B=map(int,input().split())
if (B-A)%2==0:
    print((B-A)//2)
else:
    if A<=N-B:
        print(A+(B-A)//2)
    else:
        print(N-B+1+(B-A)//2)
Buggy code:
x,a,b=map(int,input().split())
if (b-a)%2 == 0:
    print((b-a)//2)
else:
    print(min( a + (b-a-1)//2, n - b + 1 + (b-a-1)//2) )
    

Fixed code:
x,a,b=map(int,input().split())
if (b-a)%2 == 0:
    print((b-a)//2)
else:
    print(min( a + (b-a-1)//2, x - b + 1 + (b-a-1)//2) )
Buggy code:
def solve(N, A, B):
    if A % 2 == B % 2:
        return (B - A) / 2
    return min(A - 1, N - B) + 1 + (B - A - 1)//2

if __name__ == "__main__":
    n, a, b = map(int, input().split())
    print(solve(n, a, b))


Fixed code:
def solve(N, A, B):
    if A % 2 == B % 2:
        return (B - A) // 2
    return min(A-1, N-B) + 1 + (B - A -1)//2

if __name__ == "__main__":
    n, a, b = map(int, input().split())
    print(solve(n, a, b))
Buggy code:
N, A, B = [int(n) for n in input().split()]
if (B-A)%2==0:
    print((B-A)/2)
else:
    print((B-A-1)/2)


Fixed code:
N, A, B = [int(n) for n in input().split()]
if (B-A)%2==0:
    print((B-A)//2)
else:
    if (A-1) < (N-B):
        print(A+(B-A)//2)
    else:
        print((N-B+1)+(B-A)//2)
Buggy code:
n,a,b=map(int,input().split())
ans =0

if (a-b)%2:
    ans = min(a+(b-a-1)//2,(n-b+1)+(b-a-1)//2)
else:
    ans = (a-b)//2
print(ans)

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

if abs(a - b) % 2 == 0:
    ans = abs(a - b) // 2
else:
    ans = min(a + (b - a - 1) // 2, (n - b + 1) + (n - (a + n - b + 1)) // 2)

print(ans)
Buggy code:
N, A, B = map(int, input().split())

if (B-A) % 2 == 0:
    ans = (B-A+2)//2-1
else:
    if min(A-1, N-B)==A-1:
        ans=B-1
        B-=A
        A=1
    else:
        ans=N-A
        A+=N-B+1
        B=N
    print(A,B)
    if A!=B:
        ans = (B-A+2)//2-1
    
print(ans)


Fixed code:
N,A,B=map(int,input().split())
if (B-A)%2==0:
    ans=(B-A)//2
else:
    ans=min(A-1,N-B)+(B-A+1)//2
print(ans)
Buggy code:
n,a,b = map(int,input().split())
if abs(a-b)%2 == 0:
  print(abs(a-b)//2)
else:
  print(min((a+b+1)//2,(n-a+n-b+1)//2)

Fixed code:
n,a,b = map(int,input().split())
if a%2 == b%2:
    print((b-a)//2)
else:
    print(min(a-1,n-b)+1+(b-a-1)//2)
Buggy code:
n, a, b = map(int, input().split())

if (a - b) % 2 == 0:
    print((a - b)//2)
    exit()

if a > b:
    a, b = b, a

print(min(a + (b-a-1)//2, n - b + 1 + (n - (a + (n - b + 1)))//2))

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

if (a - b) % 2 == 0:
    print(abs((a - b)//2))
    exit()

if a > b:
    a, b = b, a

print(min(a + (b-a-1)//2, n - b + 1 + (n - (a + (n - b + 1)))//2))
Buggy code:
n, a, b = list(map(int, input().split()))
k = b - a
if k % 2 == 1:
    print(min(a-1, n-b)+1+(z-1)//2)
else:
    print(z//2)


Fixed code:
n, a, b = list(map(int, input().split()))
k = b - a
if k % 2 == 1:
    print(min(a-1, n-b)+1+(k-1)//2)
else:
    print(k//2)
Buggy code:
n,a,b = map(int,input().split())
if abs(a-b)%2 == 0:
  print(abs(a-b)//2)
else:
  print((abs(a-b)+1)//2)

Fixed code:
n,a,b = map(int,input().split())
if abs(a-b)%2 == 0:
  print(abs(a-b)//2)
else:
  print(min((a+b-1)//2,(n-a+n-b+1)//2))
Buggy code:
n,a,b = map(int,input().split())

if(( a + b ) % 2 == 0):
    print(int((b-a)/2))
    exit()

if(a < ( n - b )):
    print(int(a + ((b-a-1)/2)))
else:
    print(int(n-b + 1 + (b-a-1)/2))

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

if (b-a)%2==0:
  print((b-a)//2)
  exit()
else:
  print(min(
    (n-a),
    (b-1),
    (((b-a-1)//2)+n-b+1),
    (((b-a-1)//2)+a)
  ))
Buggy code:
s=list(map(int,input().split()))
if (s[2]-s[1])%2==0:
  print(int((s[2]-s[1])//2))
else:
  if s[2]-1>=s[0]-s[1]:
    if (s[0]-(s[0]-s[2]+1+s[1]))//2+s[0]-s[2]+1>s[0]-s[1]:
      print(s[0]-s[1])
    else:
      print((s[0]-(s[0]-s[2]+1+s[1]))//2+s[0]-s[2]+1)
  else:
    if (s[2]-s[1]-1)//2+s[2]-s[1]>s[2]-1:
      print(s[2]-1)
    else:
      print((s[2]-s[1]-1)//2+s[2]-s[1])

Fixed code:
s=list(map(int,input().split()))
if (s[2]-s[1])%2==0:
  print(int((s[2]-s[1])//2))
else:
  if s[2]-1>=s[0]-s[1]:
    if (s[2]-s[1]-1)//2+s[0]-s[2]+1>s[0]-s[1]:
      print(s[0]-s[1])
    else:
      print(int((s[2]-s[1]-1)//2+s[0]-s[2]+1))
  else:
    if (s[2]-s[1]-1)//2+s[1]>s[2]-1:
      print(s[2]-1)
    else:
      print(int((s[2]-s[1]-1)//2+s[1]))
Buggy code:
n, a, b = map(int, input().split())

diff = b - a

if diff % 2 == 0:
	print(diff//2)
else:
	if a < n - b:
		print(b-1)
	else:
		print(n-a)
		


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

diff = b - a

if diff % 2 == 0:
	print(diff//2)
else:
	if a < n - b + 1:
		if diff > 0:
			print(a + (diff-1)//2)
		else:
			print(a)
	else:
		if diff > 0:
			print(n-b+1 + (diff)//2)
		else:
			print(n-b+1)
Buggy code:
N,a,b = map(int,input().split())

if (b-a)%2 ==0:
  ams = (b-a)//2
else:
  ans = min(a-1,N-b)+1 + (b-a-1)//2
print(ans)

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

if (b-a)%2 ==0:
  ans = (b-a)//2
else:
  ans = min(a-1,N-b)+1 + (b-a-1)//2
print(ans)
Buggy code:
N, A, B = map(int, input().split())
diff = abs(A - B)

if diff % 2 == 0:
    print(diff // 2)

else:
    n = B - A
    n = n if n % 2 == 0 else n + 1
    print(n//2)


Fixed code:
N, A, B = map(int, input().split())
diff = abs(A - B)

if diff % 2 == 0:
    print(diff // 2)

else:
    n = (diff // 2) + 1 + min(N-B, A-1)
    print(n)
Buggy code:
n,a,b =map(int,input().split())
if ((b - a) % 2 == 0):
    print(min(max(b-1,n-a),(b-a)//2))
else:
    print(max(b-1,n-a))

Fixed code:
n, a, b = map(int, input().split())
if (b-a) % 2 == 0:
    print((b-a)//2)
else:
    print(min(n-b, a-1)+(b-a+1)//2)
Buggy code:
N, A, B = map(int, input().split())
if (B - A) % 2 == 0:
  ret = (B - A) / 2
else:
  ret = min(N - A, B - 1)
print(ret)

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

if (B-A)%2==0:
    print((B-A)//2)
else:
    print(min(N-B,A-1)+(B-A+1)//2)
Buggy code:
n,a,b=map(int,input().split())
check=(b-a)%2
if check==0:
  ans=(b-a)/2
  print(ans)
else:
  ans=min(n-b,a-1)+1+(b-a-1)//2
  print(ans)

Fixed code:
n,a,b=map(int,input().split())
check=(b-a)%2
if check==0:
  ans=(b-a)//2
  print(ans)
else:
  ans=min(n-b,a-1)+1+(b-a-1)//2
  print(ans)
Buggy code:
N,A,B = map(int,input().split())
if A % 2 == B % 2:
    print((B - A) // 2)
else:
    print(min(A - 1, N - B) + (B - A - 1) / 2)


Fixed code:
N,A,B = map(int, input().split())
if A % 2 == B % 2:
    print((B-A) // 2)
else:
    x = min(B - 1, N - A)
    y = 1 + min(A - 1, N - B) + (B - A) // 2
    print(min(x, y))
Buggy code:
N,A,B=map(int,input().split())
if((B-A)%2==0):
  print((B-A)//2)
else:
  print(min(N-A,B-1,(B-A-1)//2))

Fixed code:
N, A, B = map(int, input().split())
if (A - B) % 2 == 0:
    print((B - A) // 2)
else:
    print(min(A - 1, N - B) + 1 + (B - A - 1) // 2)
Buggy code:
n, a, b = map(int, input().split())
d = b-1
e = n-a
c =  min(d, e)
if (b-a%2)==0:
    print((b-a)//2)
else:
    print(c)

Fixed code:
n, a, b = map(int, input().split())
if (b-a)%2==0:
    print((b-a)//2)
else:
    d = a - 1
    e = n - b
    c = min(d, e)
    ans = (b-a-1)//2+c+1
    print(ans)
Buggy code:
n,a,b=map(int,input().split())
if (a-b)%2==0:
 print((b-a)/2))
else:
 print(min(int((2*(a-1)+b-a+1)/2),int((2*(n-b)+b-a+1)/2)))

Fixed code:
n,a,b =map(int, input().split())
if (b-a)%2==0:
    print((b-a)//2)
else:
    if b-a==1:
        print(min(b-1,n-a))
    else:
        if (b-1)>=n-a:
            print((n-b)+1+((n-(a+n+1-b))//2))
        else:            
            print(a+((b-a-1)//2))
Buggy code:
N,A,B = map(int, input().split())

if A == B:
    print((B-A)/2)
else:
    print(min(A-1, B-1) + 1 + (B-A-1)/2)

Fixed code:
N, A, B = map(int, input().split())
print((B-A)//2 if A & 1 == B & 1 else min(A-1, N-B) + 1 + (B-A-1)//2)
Buggy code:
N, A, B = [int(i) for i in input().split()]
ans = []
if (B-A)%2 == 0:
    print((B-A)/2)
else:
    print((B-A)//2+1+min([A-1,N-B]))

Fixed code:
N, A, B = [int(i) for i in input().split()]
ans = []
if (B-A)%2 == 0:
    print(int((B-A)//2))
else:
    print(int((B-A)//2+1+min([A-1,N-B])))
Buggy code:
N,A,B = map(int,input().split())

if (B - A) % 2 == 0:
  print((B - A) // 2)
else:
  NA = N - A
  B1 = B - 1
  if NA < B1:
    distance = N - B
    adjust = distance + 1
    moveA = A + adjust
    print(((N - moveA) // 2) + adjust)
  else:
    distance = A - 1
    adjust = distance + 1
    moveB = B + adjust
    print(((A - moveB) // 2) + adjust)

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

if (B - A) % 2 == 0:
  print((B - A) // 2)
else:
  NA = N - A
  B1 = B - 1
  if NA < B1:
    distance = N - B
    adjust = distance + 1
    moveA = A + adjust
    print(((N - moveA) // 2) + adjust)
  else:
    distance = A - 1
    adjust = distance + 1
    moveB = B - adjust
    print(((moveB - 1) // 2) + adjust)
Buggy code:
N,A,B = map(int,input().split())
S = B-A
C = 0
 
if S % 2 ==0:
  C = S / 2
else:
  D = min(N-A,B-1)
  if A-1 <= N-B:
    E = A + S//2
  else:
    E = N-B+1 + S//2
  C = min(D,E)
 
print(int(C-1))

Fixed code:
N,A,B = map(int,input().split())
S = B-A
 
if S % 2 ==0:
  C = S // 2
else:
  D = min(N-A,B-1)
  if A-1 <= N-B:
    E = A + (S-1)//2
  else:
    E = N-B+1 + (S-1)//2
  C = min(D,E)
 
print(int(C))
Buggy code:
#A - Table Tennis Training
N,A,B = list(map(int, input().split()))

if Lab%2==0:
    #case Lab is even
    ans = int(B-A/2)
else:
    #case Lab is odd
    ans = min(A-1,N-B) + 1 + int((B-A-1)/2)

print(ans)

Fixed code:
#A - Table Tennis Training
N,A,B = list(map(int, input().split()))

Lab = B-A
La = A-1
Lb = N-B

if Lab%2==0:
    #case Lab is even
    ans = Lab//2
else:
    #case Lab is odd
    ans = min(La,Lb) + 1 + Lab//2

print(ans)
Buggy code:
N,A,B = map(int,input().split())
step = 0
if (A-B)%2 == 0:
    step = (B-A)/2
    print(int(step))
else:
    step = min(A,N-B-1)+(B-A-1)/2
    print(step)

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

if (B-A)%2 == 0:
  print((B-A)//2)
else:
  print(min( A-1 , N-B) + 1 + (B-A-1)//2)
Buggy code:
N, A, B = map(int, input().split())
if (A + B) % 2 == 0:
  print((A + B) // 2)
else:
  print(min((2 * N - A - B + 1) // 2, (A + B - 1) // 2))

Fixed code:
N, A, B = map(int, input().split())
if (A + B) % 2 == 0:
  print(abs(A - B) // 2)
else:
  print(min((2 * N - A - B + 1) // 2, (A + B - 1) // 2))
Buggy code:
import sys
import math
from collections import deque
MAX_INT = int(10e15)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

N, A, B = IL()

if (B - A)%2 == 0:
  print((B - A)//2)
else:
  ans = min(min(A, B) - 1, N - max(A, B))
  print(ans + (B - A)//2)

Fixed code:
import sys
import math
from collections import deque
MAX_INT = int(10e15)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

N, A, B = IL()

if (B - A)%2 == 0:
  print((B - A)//2)
else:
  ans = min(A - 1, N - B)
  print(ans + (B - A)//2 + 1)
Buggy code:
N,a,b=map(int,input().split())

if (b - a)%2 == 0:
  ans = int((b - a)/2)
else:
  ans4 = a-1 + (b-a-1)/2 +1
  ans5 = N-b + (b-a-1)/2 +1
  ans = int(min(ans4,ans5)-1)
  
print(ans)

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

if (b - a)%2 == 0:
  ans = int((b - a)//2)
else:
  ans4 = int(int(a) + int((b-a-1)//2))
  ans5 = int(int(N-b+1) + int((b-a-1)//2))
  ans = int(min(ans4,ans5))
  
print(ans)
Buggy code:
N,A,B=input().split()
if (int(B)-int(A))%2==0:
    print((int(B)-int(A))/2)
else:
    print(min(int(A)-1,int(N)-int(B))+1+((int(B)-int(A)-1)/2))


Fixed code:
N,A,B=map(int,input().split())
if (B-A)%2==0:
    print((B-A)//2)
else:
    print(min(A-1,N-B)+(B-A+1)//2)
Buggy code:
N,A,B = list(map(int,input().split()))
if (A+B) %2 == 0:
  print(abs(B-A)//2)
else:
  print(min((A+B+1)//2,(N-A+1+N-B)//2))
  

Fixed code:
N,A,B = map(int,input().split())
if (A-B)%2 == 0:
    ans = abs(A-B)//2
else:
    ans = min(min(A-1,B-1)+1+(abs(A-B)-1)//2,min(N-A,N-B)+1+(abs(A-B)-1)//2)
print(ans)
Buggy code:
n, a, b = map(int, input().split())

if (b - a)%2 == 0:
    print(int((b-a)/2))
else:
    print(int(min(n-a, b-1)+1+(b-a-1)/2))

Fixed code:
n, a, b = map(int, input().split())
if (b - a) % 2 == 0:
    ans = (b-a)//2
else:
    ans = min(a-1, n-b) + 1 + (b-a-1)//2
print(ans)
Buggy code:
n,a,b=map(int,input().split())

a_length=a
b_length=n-b

if not (b-a)%2:
    print(b-a//2)
elif b_length>=a_length:
    print(a+(b-a-1)//2)
elif b_length<a_length:
    print(n-b+(b-a)//2+1)

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

a_length=a-1
b_length=n-b

if not (b-a)%2:
    print((b-a)//2)
elif b_length>=a_length:
    print(a+(b-a-1)//2)
elif b_length<a_length:
    print(n-b+1+(b-a-1)//2)
Buggy code:
n, a, b = map(int, input().split())

if (b - a) % 2 == 0:
    print(int(abs(a - b)/2))
elif (b - a) % 2 == 1:

    upfold = a - 1
    downfold = n - b

    print(int(min([upfold, downfold]) + (b - a - 1)/2))

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

if (b - a) % 2 == 0:
    print(int(abs(a - b)//2))
elif (b - a) % 2 == 1:

    print(min([a, n - b + 1]) + (b - a - 1)//2)
Buggy code:
N, A, B = map(int, input().split())


d = B-A
if d%2 == 1:
    d = min((B + (N-B)*2 + 1) - A, B - (-A-1))

ans = d//2
print(ans)


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


d = B-A
if d%2 == 1:
    d = min((B + (N-B)*2 + 1) - A, B - (A - (A-1)*2 - 1))

ans = d//2
print(ans)
Buggy code:
N,A,B=map(int,input().split())
if (A+B)%2==0:
  print((B-A)//2)
else:
  if (A-1)<=(N-B):
    print((2A-1)+(B-A)//2)
  else:
    print((2B-1)+(B-A)//2)

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

if (B-A) % 2 == 0:
    print((B-A)//2)
else:
    if A-1<N-B:
        print(A-1+1+((B-A-1)//2))
    else:
        print(N-B+1+((B-A-1)//2))
Buggy code:
n,a,b = map(int, input().split())
if b-a % 2 == 0:
  print(abs(b-a)//2)
else:
  print(min(max(n-a,n-b),max(a-1,b-1)))

Fixed code:
n,a,b = map(int, input().split())
if (b-a) % 2 == 0:
  print(abs(b-a)//2)
else:
  print(min(min(n-a,n-b),min(a-1,b-1)) + abs(b-a)//2 + 1)
Buggy code:
a_list=[1,2,3]
p,q= input().split()
a_list.remove(int(p))
a_list.remove(int(q))
print(a_list[0])

Fixed code:
a_list=[1,2,3]
p= input()
q=input()
a_list.remove(int(p))
a_list.remove(int(q))
print(a_list[0])
Buggy code:
a = input()
b = input()

if (a != 1 and b != 1):
  print(1)
elif (a != 2 and b != 2):
  print(2)
else:
  print(3)

Fixed code:
a = int(input())
b = int(input())
 
if (a != 1 and b != 1):
  print(1)
elif (a != 2 and b != 2):
  print(2)
else:
  print(3)
Buggy code:
A = input()
B = input()

ans = [1,2,3]
ans.remove(A)
ans.remove(B)
print(ans[0])

Fixed code:
A = int(input())
B = int(input())
ans = [1,2,3]
ans.remove(A)
ans.remove(B)
print(ans[0])
Buggy code:
# -*- coding:utf-8 -*-
A=int(input())
B=int(input())
if A+B==3:
    print(3)
elif A+B=4:
    print(2)
else:
    print(1)

Fixed code:
# -*- coding:utf-8 -*-
A=int(input())
B=int(input())
if A+B==3:
    print(3)
elif A+B==4:
    print(2)
else:
    print(1)
Buggy code:
l = [1,2,3]
a = int(input())
b = int(input())
c = [o for o in l if o in not [a,b]]
print(c[0])

Fixed code:
l = [1,2,3]
a = int(input())
b = int(input())
c = [o for o in l if o not in [a,b]]
print(c[0])
Buggy code:
a=input()
b=input()
x=[0 for _ in range(3)]
x[a-1]=1
x[b-1]=1
for i in range(3):
  if x[i]==0:
    print(i+1)
    break


Fixed code:
a=int(input())
b=int(input())
x=[0 for _ in range(3)]
x[a-1]=1
x[b-1]=1
for i in range(3):
  if x[i]==0:
    print(i+1)
    break
Buggy code:
from sys import stdin

A = stdin.readline().rstrip()
B = stdin.readline().rstrip()

if A == 1:
    if B == 2:
        print(3)
        exit()
    else:
        print(2)
        exit()
elif A == 2:
    if B == 1:
        print(3)
        exit()
    else:
        print(1)
        exit()
else:
    if B == 1:
        print(2)
        exit()
    else:
        print(3)
        exit()


Fixed code:
from sys import stdin

A = int(stdin.readline().rstrip())
B = int(stdin.readline().rstrip())

if A == 1:
    if B == 2:
        print(3)
        exit()
    else:
        print(2)
        exit()
elif A == 2:
    if B == 1:
        print(3)
        exit()
    else:
        print(1)
        exit()
else:
    if B == 1:
        print(2)
        exit()
    else:
        print(1)
        exit()
Buggy code:
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))

a = int(input())
b = int(input())

if (a == 1 and b == 2):
    print(3)
elif(a == 1 and b == 3):
    print(2)
else:
    print(1)


Fixed code:
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))

a = int(input())
b = int(input())

if (a == 1 and b == 2):
    print(3)
elif(a == 1 and b == 3):
    print(2)
elif (a == 2 and b == 1):
    print(3)
elif (a == 2 and b == 3):
    print(1)
elif (a == 3 and b == 1):
    print(2)
elif (a == 3 and b == 2):
    print(1)
Buggy code:
A=int(input())
print(6-A-int(input())

Fixed code:
A=int(input())
print(6-A-int(input()))
Buggy code:
import math as m
from array import *
import sys
import datetime
import calendar


a= int(input())
b=int(input())

if a==1 and b==2:
    print(3)
if a==2 and b==3:
    print(1)
if a==3 and b==1:
    print(3)
if a==3 and b==2:
    print(1)
if a==1 and b==3:
    print(2)
if a==3 and b==1:
    print(2)


Fixed code:
import math as m
from array import *
import sys
import datetime
import calendar


a= int(input())
b=int(input())

if a==1 and b==2:
    print(3)
if a==2 and b==3:
    print(1)
if a==2 and b==1:
    print(3)
if a==3 and b==2:
    print(1)
if a==1 and b==3:
    print(2)
if a==3 and b==1:
    print(2)
Buggy code:
a,b = map(int ,input().split())
l=[1,2,3]
l.pop(l.index(a))
l.pop(l.index(b))
print(l[0])

Fixed code:
a = int(input())
b = int(input())

l=[1,2,3]
l.pop(l.index(a))
l.pop(l.index(b))
print(l[0])
Buggy code:
l=[1,2,3]
for i in range(2):
    l.remove(int(input))
print(l[0])

Fixed code:
l=[1,2,3]
for i in range(2):
	l.remove(int(input()))
print(l[0])
Buggy code:
A = int(input())
B = int(input())
C = [1,2,3]
C.remove(A)
C.remove(B)
print(C)

Fixed code:
A = int(input())
B = int(input())
C = [1,2,3]
C.remove(A)
C.remove(B)
print(C[0])
Buggy code:
a=int(input())
b=int(input())
l=[1,2,3]
l.remove(a)
l.remove(b)
print(l)

Fixed code:
l=[1,2,3]
a=int(input())
l.remove(a)
b=int(input())
l.remove(b)
print(l[0])
Buggy code:
a = {1, 2, 3}
a.remove(int(input())
a.remove(int(input())
print(list(a)[0])

Fixed code:
a = {1, 2, 3}
a.remove(int(input()))
a.remove(int(input()))
print(list(a)[0])
Buggy code:
A = int(input())
B = int(input())

ans_list = []
ans_list.append(A)
ans_list.append(B)
correct_list = [1,2,3]

ans = list(set(correct_list) - set(ans_list))
print(ans)

Fixed code:
A = int(input())
B = int(input())

ans_list = []
ans_list.append(A)
ans_list.append(B)
correct_list = [1,2,3]

ans = list(set(correct_list) - set(ans_list))
print(ans[0])
Buggy code:
A = int(input())
B = int(input())
if A == 1 and B == 2:
  print(3)
elif A == 2 and B == 3:
  print(1)
elif A == 1 and B == 3:
  print(2)

Fixed code:
A = int(input())
B = int(input())
if A == 1 and B == 2:
  print(3)
elif A == 1 and B == 3:
  print(2)
elif A == 2 and B == 3:
  print(1)
elif A == 2 and B == 1:
  print(3)
elif A == 3 and B == 1:
  print(2)
elif A == 3 and B == 2:
  print(1)
Buggy code:
A = int(input())
B = int(input())

if A == 1 and B == 2:
	print(3)
elif A == 1 and B == 3:
	print(2)
else:
	print(1)

Fixed code:
A = int(input())
B = int(input())

if A == 1 and B == 2:
  print(3)
elif A == 2 and B == 1:
  print(3)
elif A == 3 and B == 1:
  print(2)
elif A == 1 and B == 3:
  print(2)  
elif A == 2 and B == 3:
  print(1)
elif A == 3 and B == 2:
  print(1)
Buggy code:
a=int(input())
b=int(input())
c=0
if a==1:
  if b==2:
    c=3
  if b==3:
    c=2
elif a==2:
  if b==1:
    c==3
  if b==3:
    c==1
elif a==3:
  if b==1:
    c==2
  if b==2:
    c==1
print(c)    

Fixed code:
a=int(input())
b=int(input())
if a==1:
  if b==2:
    c=3
  elif b==3:
    c=2
elif a==2:
  if b==1:
    c=3
  elif b==3:
    c=1
elif a==3:
  if b==1:
    c=2
  elif b==2:
    c=1
print(c)
Buggy code:
a = int(input())
b = int(input())
ans = 1 if 1 not in (a, b) else 2 if not in (a, b) else 3
print(ans)

Fixed code:
a, b = int(input()), int(input())
ans = 1 if 1 not in (a, b) else 2 if 2 not in (a, b) else 3
print(ans)
Buggy code:

s = [1,2,3]
s.remove(int(input()))
s.remove(int(input()))
print(s)

Fixed code:
s = [1,2,3]
s.remove(int(input()))
s.remove(int(input()))
print(s[0])
Buggy code:
a = int(input())
b = int(input())
print(6-a+b)

Fixed code:
a=input()
b=input()
print(6-int(a)-int(b))
Buggy code:
A = int(input())
B = int(input())
print((set(range(1, 3 + 1)) - {A, B})[0])

Fixed code:
A = int(input())
B = int(input())
print(list(set(range(1, 3 + 1)) - {A, B})[0])
Buggy code:
a=int(input())
b=int(input())
Z=[1,2,3]
Z.remove(a)
Z.remove(b)

print(Z)


Fixed code:
a=int(input())
b=int(input())
Z=[1,2,3]
Z.remove(a)
Z.remove(b)

print(Z[0])
Buggy code:
a = int(input())
b = int(input())
nums = [1, 2, 3]

for n in nums:
  if((a != n) and (b != n):
     print(n)


Fixed code:
a = int(input())
b = int(input())
nums = [1, 2, 3]
 
for n in nums:
  if((a != n) and (b != n)):
     print(n)
Buggy code:
li=[1,2,3]
li.pop(int(input()))
li.pop(int(input()))
print(li[0])

Fixed code:
li=[1,2,3]
li.pop(li.index(int(input())))
li.pop(li.index(int(input())))
print(li[0])