qyliang/CodeNanoFix huggingface dataset:
Buggy code:
c = [list(map(int, input().split())) for i in range(3) ]

ans = False

for i in range(max(c)) :
    a1 = 0
    b1 = c[0][0]
    b2 = c[0][1]
    b3 = c[0][2]
    a2 = c[1][0] - b1
    a3 = c[2][0] - b1
    a = []
    a.append(a1)
    a.append(a2)
    a.append(a3)
    if a2 + b2 != c[1][1] :
        continue
    elif a3 + b2 != c[2][1] :
        continue
    elif a2 + b3 != c[1][2] :
        continue
    elif a3 + b3 != c[2][2] :
        continue
    ans = True
    break

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


Fixed code:
c = [list(map(int, input().split())) for i in range(3) ]

ans = False

for i in range(101) :
    a1 = 0
    b1 = c[0][0]
    b2 = c[0][1]
    b3 = c[0][2]
    a2 = c[1][0] - b1
    a3 = c[2][0] - b1
    a = []
    a.append(a1)
    a.append(a2)
    a.append(a3)
    if a2 + b2 != c[1][1] :
        continue
    elif a3 + b2 != c[2][1] :
        continue
    elif a2 + b3 != c[1][2] :
        continue
    elif a3 + b3 != c[2][2] :
        continue
    ans = True
    break

if ans :
    print('Yes')
else :
    print('No')
Buggy code:
c=[list(map(int,input().split())) for i in range(3)]



for i in range(101):
　info=True
　a1=i
  b1=c[0][0]-a1
  b2=c[0][1]-a1
  b3=c[0][2]-a1
  a2=c[1][0]-b1
  a3=c[2][0]-b1
  if min(a1,a2,a3,b1,b2,b3)<0:
    info=False
  if c[1][1]!=a2+b2:
    info=False
  if c[2][1]!=a3+b2:
    info=False
  if info:
    print("Yes")
    break
else:
  print("No")

Fixed code:
c=[list(map(int,input().split())) for i in range(3)]


  
for i in range(101):
  info=True
  a1=i
  b1=c[0][0]-a1
  b2=c[0][1]-a1
  b3=c[0][2]-a1
  a2=c[1][0]-b1
  a3=c[2][0]-b1
  if min(a1,a2,a3,b1,b2,b3)<0:
    info=False
  if c[1][1]!=a2+b2:
    info=False
  if c[2][1]!=a3+b2:
    info=False
  if c[1][2]!=a2+b3:
    info=False
  if c[2][2]!=a3+b3:
    info=False
  
  if info:
    print("Yes")
    break
else:
  print("No")
Buggy code:
ls = [[int(x) for x in input().split()] for _ in range(3)]

flg = "Yes"

for i in range(2):
    if ls[0][i]-ls[0][i] == ls[1][i]-ls[1][i] and ls[0][i]-ls[0][i] == ls[2][i]-ls[2][i]:
        pass
    else:
        flg = "No"
print(flg)

Fixed code:
ls = [[int(x) for x in input().split()] for _ in range(3)]

flg = "Yes"

for i in range(2):
    if ls[0][i]-ls[0][i+1] == ls[1][i]-ls[1][i+1] and ls[0][i]-ls[0][i+1] == ls[2][i]-ls[2][i+1]:
        pass
    else:
        flg = "No"
print(flg)
Buggy code:
def solve():
    if not (c11 - c21 == c12 - c22 == c13 - c23):
        return False
    if not (c11 - c31 == c12 - c32 == c13 - c33):
        return False
    if not (c11 - c12 == c21 - c22 == c31 - c32):
        return False
    if not (c11 - c13 == c21 - c23 == c31 - c33):
        return False
    return True
  
c11, c12, c13 = map(int, input().split())
c21, c22, c23 = map(int, input().split())
c31, c32, c33 = map(int, input().split())
 
if(solve()):
  print("Yes")
else:
  print("N0")

Fixed code:
def solve():
    if not (c11 - c21 == c12 - c22 == c13 - c23):
        return False
    if not (c11 - c31 == c12 - c32 == c13 - c33):
        return False
    if not (c11 - c12 == c21 - c22 == c31 - c32):
        return False
    if not (c11 - c13 == c21 - c23 == c31 - c33):
        return False
    return True
 
 
c11, c12, c13 = map(int, input().split())
c21, c22, c23 = map(int, input().split())
c31, c32, c33 = map(int, input().split())
 
print('Yes' if solve() else 'No')
Buggy code:
C = [list(map(int, input().split())) for _ in range(3)]
a1 = 0
b1 = C[0][0] - a1
b2 = C[0][1] - a1
b3 = C[0][2] - a1
a2 = C[1][0] - b1
a3 = C[2][0] - b1
if C[0][0] == a1 + b1 :
    if C[0][0] == a1 + b1 :
        if C[0][0] == a1 + b1 :
            print('Yes')
else :
    print('No')

Fixed code:
C = [list(map(int, input().split())) for _ in range(3)]
a1 = 0
b1 = C[0][0] - a1
b2 = C[0][1] - a1
b3 = C[0][2] - a1
a2 = C[1][0] - b1
a3 = C[2][0] - b1
if C[1][1] == a2 + b2 and C[1][2] == a2 + b3 and C[2][1] == a3 + b2 and C[2][2] == a3 + b3:
    print('Yes')
else :
    print('No')
Buggy code:
import sys
C = [list(map(int, sys.stdin.readline().split(" "))) for i in range(3)]
for a0 in range(101):
    b1 = C[0][0] - a0
    b2 = C[0][1] - a0
    b3 = C[0][2] - a0
    if (C[1][0] - b0 == C[1][1] - b1 == C[1][2] - b2) and (C[2][0] - b0 == C[2][1] - b1 == C[2][2] - b2):
        print("Yes")
        exit()
print("No")

Fixed code:
import sys
C = [list(map(int, sys.stdin.readline().split(" "))) for i in range(3)]
for a0 in range(101):
    b0 = C[0][0] - a0
    b1 = C[0][1] - a0
    b2 = C[0][2] - a0
    if (C[1][0] - b0 == C[1][1] - b1 == C[1][2] - b2) and (C[2][0] - b0 == C[2][1] - b1 == C[2][2] - b2):
        print("Yes")
        exit()
print("No")
Buggy code:
c = ['' for _ in range(3)]
c[0] = list(map(int, input().split()))
c[1] = list(map(int, input().split()))
c[2] = list(map(int, input().split()))
ans = 'Yes'
print(c)
for i in range(2):
    for j in range(2):
        if c[i][j] + c[i + 1][j + 1] != c[i][j + 1] + c[i + 1][j]:
            ans = 'No'
            break
    else:
        continue
    break
print(ans)


Fixed code:
c = ['' for _ in range(3)]
c[0] = list(map(int, input().split()))
c[1] = list(map(int, input().split()))
c[2] = list(map(int, input().split()))
ans = 'Yes'
for i in range(2):
    for j in range(2):
        if c[i][j] + c[i + 1][j + 1] != c[i][j + 1] + c[i + 1][j]:
            ans = 'No'
            break
    else:
        continue
    break
print(ans)
Buggy code:
C=[0]*3;A=[0]*3
d1=0;d2=0;e1=0;e2=0;z=0;p=0
for i in range(3):
  c1,c2,c3=map(int,input().split())
  C[i]=(c1,c2,c3)
  A[i]=(0,0,0)

d1=C[1][0]-C[0][0];d2=C[2][0]-C[0][0]
e1=C[0][1]-C[0][0];e2=C[0][2]-C[0][0]
z=C[0][0]
A[0][0]=z;A[0][1]=z+e1;A[0][2]=z+e2
A[1][0]=z+d1;A[1][1]=z+e1+d1;A[1][2]=z+d1+e2
A[2][0]=z+d2;A[2][1]=z+d2+e1;A[2][2]=z+d2+e2

print(C)
for i in range(3):
  for j in range(3):
    if C[i][j]==A[i][j]:
      p=p+1
print("Yes" if p==9 else "No")

Fixed code:
C=[0]*3;A=[0]*3
d1=0;d2=0;e1=0;e2=0;z=0;p=0
for i in range(3):
  c1,c2,c3=map(int,input().split())
  C[i]=[c1,c2,c3]
  A[i]=[0,0,0]
 
d1=C[1][0]-C[0][0];d2=C[2][0]-C[0][0]
e1=C[0][1]-C[0][0];e2=C[0][2]-C[0][0]
z=C[0][0]
A[0][0]=z;A[0][1]=z+e1;A[0][2]=z+e2
A[1][0]=z+d1;A[1][1]=z+e1+d1;A[1][2]=z+d1+e2
A[2][0]=z+d2;A[2][1]=z+d2+e1;A[2][2]=z+d2+e2
 
#print(C)
for i in range(3):
  for j in range(3):
    if C[i][j]==A[i][j]:
      p=p+1
print("Yes" if p==9 else "No")
Buggy code:
c11, c12, c13 = map(int, input().split())
c21, c22, c23 = map(int, input().split())
c31, c32, c33 = map(int, input().split())

ans = 'No'

# a1b1, a1b2, a1b3
# a2b1, a2b2, a2b3
# a3b1, a3b2, a3b3

for i in range(c11):
  a1 = i
  b1 = c11 - a1
  a2 = c21 - b1
  b2 = c12 - a1
  a3 = c31 - b1
  b3 = c13 - a1
  
  if (a2+b2 == c22) and (a2+b3 == c23) and (a3+b2 == c32) and (a3+b3 == c33):
    ans = 'Yes'
    break
print(ans)
  

Fixed code:
c11, c12, c13 = map(int, input().split())
c21, c22, c23 = map(int, input().split())
c31, c32, c33 = map(int, input().split())

ans = 'No'

# a1b1, a1b2, a1b3
# a2b1, a2b2, a2b3
# a3b1, a3b2, a3b3

for i in range(c11+1):
  a1 = i
  b1 = c11 - a1
  a2 = c21 - b1
  b2 = c12 - a1
  a3 = c31 - b1
  b3 = c13 - a1
  
  #print(a1, a2, a3, b1, b2, b3)
  
  if (a2+b2 == c22) and (a2+b3 == c23) and (a3+b2 == c32) and (a3+b3 == c33):
    ans = 'Yes'
    break
print(ans)
Buggy code:
c = []
c.append(list(map(int,input().split())))
c.append(list(map(int,input().split())))
c.append(list(map(int,input().split())))
sa = [[0,0,0],[0,0,0]]
for i in range(3):
    sa[0][i]=c[1][i]-c[0][i]
    sa[1][i]=c[2][i]-c[0][i]
if(all([x == sa[0][0] for x in sa[0]]) and all([x == sa[0][0] for x in sa[0]])):
    print("Yes")
else:
    print("No")


Fixed code:
c = []
c.append(list(map(int,input().split())))
c.append(list(map(int,input().split())))
c.append(list(map(int,input().split())))
sa = [[0,0,0],[0,0,0]]
for i in range(3):
    sa[0][i]=c[1][i]-c[0][i]
    sa[1][i]=c[2][i]-c[0][i]
if(all([x == sa[0][0] for x in sa[0]]) and all([x == sa[1][0] for x in sa[1]])):
    print("Yes")
else:
    print("No")
Buggy code:
rows = []
for _ in range(3):
  rows.append(list(map(int, input().split())))
for i in range(3):
  for j in range(3):
    rows[i][j] -= rows[i][0]
ok = True
for j in range(3):
  for i in range(3):
    if rows[i][j] != rows[0][j]:
      ok = False
if ok: print("Yes")
else: print("No")

Fixed code:
rows = []
for _ in range(3):
  rows.append(list(map(int, input().split())))
for i in range(3):
  for j in range(2, -1, -1):
    rows[i][j] -= rows[i][0]
ok = True
for j in range(3):
  for i in range(3):
    if rows[i][j] != rows[0][j]:
      ok = False
if ok: print("Yes")
else: print("No")
Buggy code:
import sys
C11,C12,C13 = map(int, input().split())
C21,C22,C23 = map(int, input().split())
C31,C32,C33 = map(int, input().split())





if (abs(C11+C22) == abs(C12 - C21)) and (abs(C12+C23) == abs(C13+C22)) and (abs(C22+C33) == abs(C23 + C32)):
    print("Yes")

print("No")

Fixed code:
import sys
C11,C12,C13 = map(int, input().split())
C21,C22,C23 = map(int, input().split())
C31,C32,C33 = map(int, input().split())





if (C11+C22==C12+C21) and (C12+C23==C13+C22) and (C21+C32==C22+C31) and (C22+C33==C23+C32):
    print('Yes')
    sys.exit()


print("No")
Buggy code:
# coding: utf-8
# Here your code


n = 3
e = [[int(i) for i in input().split()] for i in range(n)] 
a = []
b = []
#for i in range(101):
a.append(0)
b.append(e[0][0] - a[0])
b.append(e[0][1] - a[0])
b.append(e[0][2] - a[0])
a.append(e[1][0] - b[0])
a.append(e[2][0] - b[0])

for i in range(3):
    for j in range(3):
        if a[i] + b[i] != e[i][j]:
            print("No")
            exit()

        
print("Yes")
    




Fixed code:
# coding: utf-8
# Here your code


n = 3
e = [[int(i) for i in input().split()] for i in range(n)] 
a = []
b = []
#for i in range(101):
a.append(0)
b.append(e[0][0] - a[0])
b.append(e[0][1] - a[0])
b.append(e[0][2] - a[0])
a.append(e[1][0] - b[0])
a.append(e[2][0] - b[0])

for i in range(3):
    for j in range(3):
        if a[i] + b[j] != e[i][j]:
            print("No")
            exit()

        
print("Yes")
Buggy code:
def dfs(depth, array, sums, b):
    if depth == 3:
        sumb=0 
        for i in b:
            sumb+=i

        a=[int((sums[0]-sumb)/3), int((sums[1]-sumb)/3), int((sums[2]-sumb)/3)]
        for i in range(3):
            for j in range(3):
                if a[i]+b[j] != array[i][j]:
                    return False
        return True
    else:
        for i in range(0, 2):
            b[depth]=i
            if dfs(depth+1, array, sums, b):
                return True
        return False

array=[]
b=[0 for i in range(3)]
sums=[0 for i in range(3)]
for i in range(3):
    array.append([int(i) for i in input().split()])

for i in range(3):
    sums[i]+=array[i][0]+array[i][1]+array[i][2]

if(dfs(0, array, sums, b)):
    print("Yes")
else:
    print("No")

Fixed code:
def dfs(depth, array, sums, b):
    if depth == 3:
        sumb=0 
        for i in b:
            sumb+=i

        a=[int((sums[0]-sumb)/3), int((sums[1]-sumb)/3), int((sums[2]-sumb)/3)]
        for i in range(3):
            for j in range(3):
                if a[i]+b[j] != array[i][j]:
                    return False
        return True
    else:
        for i in range(101):
            b[depth]=i
            if dfs(depth+1, array, sums, b):
                return True
        return False

array=[]
b=[0 for i in range(3)]
sums=[0 for i in range(3)]
for i in range(3):
    array.append([int(i) for i in input().split()])

for i in range(3):
    sums[i]+=array[i][0]+array[i][1]+array[i][2]

if(dfs(0, array, sums, b)):
    print("Yes")
else:
    print("No")
Buggy code:
c = [list(map(int, input().split())) for i in range(3)]
a = [0, 0, 0]
count = 0
for i in range(2):
    for j in range(3):
        a[j] = c[i][j] - c[i + 1][j]
        count += 1 if a[0] == a[1] == a[2] else 0
print("Yes" if count == 2 else "No")

Fixed code:
c = [list(map(int, input().split())) for i in range(3)]
a = [0, 0, 0]
count = 0
for i in range(2):
    for j in range(3):
        a[j] = c[i][j] - c[i + 1][j]
    count += 1 if a[0] == a[1] == a[2] else 0
print("Yes" if count == 2 else "No")
Buggy code:
a = [list(map(int,input().split())) for i in range(3)]
if a[0][0]-a[1][0] == a[0][1]-a[1][1] == a[0][2]-a[1][2] and a[1][0]-a[2][0] == a[1][1]-a[2][1] == a[1][2] == a[2][2]:
  print("Yes")
else:
  print("No")

Fixed code:
a = [list(map(int,input().split())) for i in range(3)]
if a[0][0]-a[1][0] == a[0][1]-a[1][1] == a[0][2]-a[1][2] and a[1][0]-a[2][0] == a[1][1]-a[2][1] == a[1][2]-a[2][2]:
  print("Yes")
else:
  print("No")
Buggy code:
import numpy as np
A= np.array([list(map(int,input()split())) for I in range (3)])

for I in range (2):
    j,k,l = A[1]-A[0]
    if not (j==k and k==l):
        print ( "No")
        quit()
    j,k,l = A[2]-A[0]
    if not (j==k and k==l):
        print ( "No")
        quit()
print("Yes")

Fixed code:
import numpy as np
A= np.array([list(map(int,input().split())) for I in range (3)])

for I in range (2):
    j,k,l = A[1]-A[0]
    if not (j==k and k==l):
        print ( "No")
        quit()
    j,k,l = A[2]-A[0]
    if not (j==k and k==l):
        print ( "No")
        quit()
print("Yes")
Buggy code:
gridNumber = []
numbers = []
for i in range(3):
    gridNumber.append(list(map(int, input().split())))

a1=0
b1=gridNumber[0][0] - a1
b2=gridNumber[0][1] - a1
b3=gridNumber[0][2] - a1

a2=gridNumber[0][1] - b1
a3=gridNumber[0][2] - b1

numbers.append([a1+b1, a1+b2, a1+b3])
numbers.append([a2+b1, a2+b2, a2+b3])
numbers.append([a3+b1, a3+b2, a3+b3])

for i in range(3):
    for j in range(3):
        if not(numbers[i][j] == gridNumber[i][j]):
            print("No")
            quit()
        else:
            pass

print("Yes")




Fixed code:
gridNumber = []
numbers = []
for i in range(3):
    gridNumber.append(list(map(int, input().split())))

a1=0
b1=gridNumber[0][0] - a1
b2=gridNumber[0][1] - a1
b3=gridNumber[0][2] - a1

a2=gridNumber[1][0] - b1
a3=gridNumber[2][0] - b1

numbers.append([a1+b1, a1+b2, a1+b3])
numbers.append([a2+b1, a2+b2, a2+b3])
numbers.append([a3+b1, a3+b2, a3+b3])

for i in range(3):
    for j in range(3):
        if not(numbers[i][j] == gridNumber[i][j]):
            print("No")
            quit()
        else:
            pass

print("Yes")
Buggy code:
def main():
    c=[list(map(int,input().split())) for i in range(3)]
    a=[0,0,0]
    b=[0,0,0]
    for i in range(1,101):
        a[0]=i
        a[1]=-1
        a[2]=-1
        b[0]=c[0][0]-a[0]
        b[1]=c[0][1]-a[0]
        b[2]=c[0][2]-a[0]
        for j in range(1,3):
            if c[j][0]-b[0]!=c[j][1]-b[1] or c[j][1]-b[1]!=c[j][2]-b[2]:
                break
            a[j]=c[j][0]-b[0]
            if j == 2 and check(a,b):

                print('Yes')
                return
    print('No')

def check(a,b):
    for i in range(0,3):
        if a[i] > 0 and b[i] > 0 :
            continue
        else:
            return False
    return True

if __name__=='__main__':
    main()


Fixed code:
def main():
    c=[list(map(int,input().split())) for i in range(3)]
    a=[0,0,0]
    b=[0,0,0]
    for i in range(0,101):
        a[0]=i
        a[1]=-1
        a[2]=-1
        b[0]=c[0][0]-a[0]
        b[1]=c[0][1]-a[0]
        b[2]=c[0][2]-a[0]
        for j in range(1,3):
            if c[j][0]-b[0]!=c[j][1]-b[1] or c[j][1]-b[1]!=c[j][2]-b[2]:
                break
            a[j]=c[j][0]-b[0]

            if j == 2 and check(a,b):
                print('Yes')
                return
    print('No')

def check(a,b):
    for i in range(0,3):
        if a[i] >= 0 and b[i] >= 0 :
            continue
        else:
            return False
    return True

if __name__=='__main__':
    main()
Buggy code:
def main():
    c=[list(map(int,input().split())) for i in range(3)]
    a=[0,0,0]
    b=[0,0,0]
    for i in range(1,101):
        a[0]=i
        a[1]=-1
        a[2]=-1
        b[0]=c[0][0]-a[0]
        b[1]=c[0][1]-a[0]
        b[2]=c[0][2]-a[0]
        for j in range(1,3):
            if c[j][0]-b[0]!=c[j][1]-b[1] or c[j][1]-b[1]!=c[j][2]-b[2]:
                break
            a[j]=c[j][0]-b[0]
            if j == 2:
                print('YES')
                return
    print('NO')

if __name__=='__main__':
    main()


Fixed code:
def main():
    c=[list(map(int,input().split())) for i in range(3)]
    a=[0,0,0]
    b=[0,0,0]
    for i in range(1,101):
        a[0]=i
        a[1]=-1
        a[2]=-1
        b[0]=c[0][0]-a[0]
        b[1]=c[0][1]-a[0]
        b[2]=c[0][2]-a[0]
        for j in range(1,3):
            if c[j][0]-b[0]!=c[j][1]-b[1] or c[j][1]-b[1]!=c[j][2]-b[2]:
                break
            a[j]=c[j][0]-b[0]
            if j == 2:
                print('Yes')
                return
    print('No')

if __name__=='__main__':
    main()
Buggy code:
import numpy as np
mat = [list(map(int, input().split())) for i in range(3)]
array = np.array(mat, dtype=np.int64)
a20 = array[2]-array[0]
a10 = array[1]-array[0]
b20 = array[:,2]-array[:,0]
b10 = array[:,1]-array[:,0]
flag  = False
if (a20==a20[0]).all() and (a10==a10[0]).all() and (b20==b20[0]).all() and (b10==b10[0]).all():
    print('OK')
    for a1 in range(0, 101):
        a2 = a1+ a10[0]
        a3 = a1 + a20[0]
        b1 = array[0,0] - a1
        b2 = b1 + b10[0]
        b3 = b1 +b20[0]
        A = np.array([[a1, a2, a3]]).T
        B = np.array([[b1, b2, b3]])
        C = A+B
        if (C == array).all():
            flag =True
            break
if flag==True:
    print('Yes')
else:
    print('No')

Fixed code:
import numpy as np
mat = [list(map(int, input().split())) for i in range(3)]
array = np.array(mat, dtype=np.int64)
a20 = array[2]-array[0]
a10 = array[1]-array[0]
b20 = array[:,2]-array[:,0]
b10 = array[:,1]-array[:,0]
flag  = False
if (a20==a20[0]).all() and (a10==a10[0]).all() and (b20==b20[0]).all() and (b10==b10[0]).all():
    for a1 in range(0, 101):
        a2 = a1+ a10[0]
        a3 = a1 + a20[0]
        b1 = array[0,0] - a1
        b2 = b1 + b10[0]
        b3 = b1 +b20[0]
        A = np.array([[a1, a2, a3]]).T
        B = np.array([[b1, b2, b3]])
        C = A+B
        if (C == array).all():
            flag =True
            break
if flag==True:
    print('Yes')
else:
    print('No')
Buggy code:
grid = list()
for i in range(3):
    grid.append([int(k) for k in input().split(" ")])


def check_vert():
    for i in range(2):
        diffs = [grid[k][i] - grid[k][i+1]for k in range(3)]
        print(diffs)
        if not len(set(diffs)) == 1:
            return False
    else:
        return True


def check_hor():
    for i in range(2):
        diffs = [grid[i][k] - grid[i+1][k] for k in range(3)]
        print(diffs)
        if not len(set(diffs)) == 1:
            return False
    else:
        return True


if check_hor() and check_vert():
    print("Yes")
else:
    print("No")

Fixed code:
grid = list()
for i in range(3):
    grid.append([int(k) for k in input().split(" ")])


def check_vert():
    for i in range(2):
        diffs = [grid[k][i] - grid[k][i+1]for k in range(3)]
        if not len(set(diffs)) == 1:
            return False
    else:
        return True


def check_hor():
    for i in range(2):
        diffs = [grid[i][k] - grid[i+1][k] for k in range(3)]
        if not len(set(diffs)) == 1:
            return False
    else:
        return True


if check_hor() and check_vert():
    print("Yes")
else:
    print("No")
Buggy code:
c1 = map(int,input().split())
c2 = map(int,input().split())
c3 = map(int,input().split())

d1 = [c2[i] - c1[i] for i in range(3)]
d2 = [c3[i] - c1[i] for i in range(3)]

if(d1[0] == d1[1] and d1[0] == d1[2] and d2[0] ==d2[1] and d2[0] == d2[2]):
  print("Yes")
else:
  print("No")

Fixed code:
c1 = list(map(int,input().split()))
c2 = list(map(int,input().split()))
c3 = list(map(int,input().split()))
 
d1 = [c2[i] - c1[i] for i in range(3)]
d2 = [c3[i] - c1[i] for i in range(3)]
 
if(d1[0] == d1[1] and d1[0] == d1[2] and d2[0] ==d2[1] and d2[0] == d2[2]):
  print("Yes")
else:
  print("No")
Buggy code:
grid = []
for i in range(3):
    grid.append([int(i) for i in input().split()])

for _ in range(100):
    a1 = i
    b1 = grid[0][0] - a1
    b2 = grid[0][1] - a1
    b3 = grid[0][2] - a1
    if  grid[1][0] - b1 == grid[1][1] - b2 == grid[1][2] - b3 and grid[2][0] - b1 == grid[2][1] - b2 == grid[2][2] - b3:
        print('Yes')
        break

print('No')


Fixed code:
grid = []
for i in range(3):
    grid.append([int(i) for i in input().split()])

for _ in range(100):
    a1 = i
    b1 = grid[0][0] - a1
    b2 = grid[0][1] - a1
    b3 = grid[0][2] - a1
    if  grid[1][0] - b1 == grid[1][1] - b2 == grid[1][2] - b3 and grid[2][0] - b1 == grid[2][1] - b2 == grid[2][2] - b3:
        print('Yes')
        exit()
print('No')
Buggy code:
c = [list(map(int, input().split())) for _ in range(3)]
for i in range(3):
  if c[i][0] - c[i][1] == c[i][1] - c[i][2] == c[i][2] - c[i][0]:
    print('No')
    quit()
print('Yes')

Fixed code:
c = [list(map(int, input().split())) for _ in range(3)]
for i in range(2):
  if not (c[i][0] - c[i + 1][0] == c[i][1] - c[i + 1][1] == c[i][2] - c[i + 1][2] and
          c[0][i] - c[0][i + 1] == c[1][i] - c[1][i + 1] == c[2][i] - c[2][i + 1]):
    print('No')
    quit()
print('Yes')
Buggy code:
l=[list(map(int,input().split())) for i in range(3)]
x=l[0][0],y=l[0][1],z=l[0][2]
a=0,b=l[1][0]-x,c=l[2][0]-x
if b+y==l[1][1] and b+z==l[1][2] and c+y==l[2][1] and c+z==l[2][2]:
  print('Yes')
else:
  print('No')
  

Fixed code:
l=[list(map(int,input().split())) for i in range(3)]
x=l[0][0]
y=l[0][1]
z=l[0][2]
a=0
b=l[1][0]-x
c=l[2][0]-x
if b+y==l[1][1] and b+z==l[1][2] and c+y==l[2][1] and c+z==l[2][2]:
  print('Yes')
else:
  print('No')
Buggy code:
c1, c2, c3 = map(int, input().split())
c4, c5, c6 = map(int, input().split())
c7, c8, c9 = map(int, input().split())
if c4-c1==c5-c2 and c5-c2 == c6-c3 and c7-c4 ==c8-c5 and c8-c5 == c9-c6:
    if c2-c1 == c5-c4 and c5-c4 == c8-c7 and c3-c2 == c6-c5 and c6-c5 == c9-c8:
      print('Yes')
    print('No')
else:
  print('No')

Fixed code:
c1, c2, c3 = map(int, input().split())
c4, c5, c6 = map(int, input().split())
c7, c8, c9 = map(int, input().split())
if c4-c1==c5-c2 and c5-c2 == c6-c3 and c7-c4 ==c8-c5 and c8-c5 == c9-c6:
    if c2-c1 == c5-c4 and c5-c4 == c8-c7 and c3-c2 == c6-c5 and c6-c5 == c9-c8:
      print('Yes')
    else:print('No')
else:
  print('No')
Buggy code:
C = [[int(c) for c in input.split()] for _ in range(3)]

if((C[0][0]-C[1][0]==C[0][1]-C[1][1]==C[0][2]-C[1][2])                    
        and(C[0][0]-C[2][0]==C[0][1]-C[2][1]==C[0][2]-C[2][2])):                  
    print("Yes")
else:
    print("No")

Fixed code:
C = [[int(c) for c in input().split()] for _ in range(3)]

if((C[0][0]-C[1][0]==C[0][1]-C[1][1]==C[0][2]-C[1][2])                    
        and(C[0][0]-C[2][0]==C[0][1]-C[2][1]==C[0][2]-C[2][2])):                  
    print("Yes")
else:
    print("No")
Buggy code:
C = []
for _ in range(3):
    c = list(map(int,input().split()))
    C.append(c)

if((C[1][1]-C[2][1]==C[1][2]-C[2][2])and(C[1][1]-C[2][1]==C[1][3]-C[2][3])
        and(C[1][1]-C[3][1]==C[1][2]-C[3][2])and(C[1][1]-C[3][1]==C[1][3]-C[3][3])
        and(C[1][1]-C[1][2]==C[2][1]-C[2][2])and(C[1][1]-C[1][2]==C[3][1]-C[3][2])
        and(C[1][1]-C[1][3]==C[2][1]-C[2][3])and(C[1][1]-C[1][3]==C[3][1]-C[3][3])):
    print("Yes")
else:  
    print("No")


Fixed code:
C = []
for _ in range(3):
    c = list(map(int,input().split()))
    C.append(c)

if((C[0][0]-C[1][0]==C[0][1]-C[1][1])and(C[0][0]-C[1][0]==C[0][2]-C[1][2])
        and(C[0][0]-C[2][0]==C[0][1]-C[2][1])and(C[0][0]-C[2][0]==C[0][2]-C[2][2])
        and(C[0][0]-C[0][1]==C[1][0]-C[1][1])and(C[0][0]-C[0][1]==C[2][0]-C[2][1])
        and(C[0][0]-C[0][2]==C[1][0]-C[1][2])and(C[0][0]-C[0][2]==C[2][0]-C[2][2])):
    print("Yes")
else:
    print("No")