qyliang/CodeNanoFix huggingface dataset:
Buggy code:
N = int(input())
ab = [[int(i) for i in input().split(" ")] for _ in range(N)]
cd = [[int(i) for i in input().split(" ")] for _ in range(N)]
ab_sort = sorted(ab, key=lambda x:(-x[0], -x[1]))
cd_sort = sorted(cd, key=lambda x:(-x[0], -x[1]))

cnt = 0
for c, d in cd_sort:
    for a, b in ab_sort:
        if a < c and b < d:
            ab_sort.remove([a, b])
            cnt += 1
print(cnt)

Fixed code:
N = int(input())
ab = [[int(i) for i in input().split(" ")] for _ in range(N)]
cd = [[int(i) for i in input().split(" ")] for _ in range(N)]
ab_sort = sorted(ab, key=lambda x:-x[1])
cd_sort = sorted(cd, key=lambda x:x[0])

cnt = 0
for c, d in cd_sort:
    for a, b in ab_sort:
        if a < c and b < d:
            ab_sort.remove([a, b])
            cnt += 1
            break

print(cnt)
Buggy code:
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

n = ni()
red = []
for _ in range(n):
    red.append(na())
blue = []
for _ in range(n):
    blue.append(na())

red.sort()
blue.sort()
ans = 0

tmp = []
for i in blue:
    for j in red:
        print(j)
        if i[0] > j[0] and i[1] > j[1]:
            tmp.append(j)
    if tmp != []:
        max_red = max(tmp, key=lambda x:x[1])
        ans += 1
        red.remove(max_red)
        tmp = []
    else:
        print("pass")
        pass

print(ans)


Fixed code:
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

n = ni()
red = []
for _ in range(n):
    red.append(na())
blue = []
for _ in range(n):
    blue.append(na())

red.sort()
blue.sort()
ans = 0

tmp = []
for i in blue:
    for j in red:
        if i[0] > j[0] and i[1] > j[1]:
            tmp.append(j)
    if tmp != []:
        max_red = max(tmp, key=lambda x:x[1])
        ans += 1
        red.remove(max_red)
        tmp = []
    else:
        pass

print(ans)
Buggy code:
n=int(input())
red=[0]*n
for i in range(n):
    a,b=map(int,input().split())
    red[i]=(a,b)
blue=[0]*n
for i in range(n):
    a,b=map(int,input().split())
    blue[i]=(a,b)
blue.sort()
c=0
for bx,by in blue:
    maxby=-1
    maxi=-1
    for i in range(len(red)):
        rx,ry=red[i]
        if rx < bx and ry < by:
            if maxby < by:
                maxby=by
                maxi=i
    if not maxi == -1:
        c+=1
        red.pop(maxi)
print(c)


Fixed code:
n=int(input())
red=[0]*n
for i in range(n):
    a,b=map(int,input().split())
    red[i]=(a,b)
blue=[0]*n
for i in range(n):
    a,b=map(int,input().split())
    blue[i]=(a,b)
blue.sort()
c=0
for bx,by in blue:
    maxry=-1
    maxi=-1
    for i in range(len(red)):
        rx,ry=red[i]
        if rx < bx and ry < by:
            if maxry < ry:
                maxry=ry
                maxi=i
    if not maxi == -1:
        c+=1
        red.pop(maxi)
print(c)
Buggy code:
n=int(input())

a=[]
for i in range(n):
    x,y=map(int,input().split())
    a.append([x,y])

b=[]
for i in range(n):
    x,y=map(int,input().split())
    b.append([x,y])


a2=sorted(a, key=lambda x: x[0])
b2=sorted(b, key=lambda x: x[0])

ans=0
for i in range(n):
    for j in range(n):
        if b2[n-1-i][0]>a2[n-1-j][0] and b2[n-1-i][1]>a2[n-1-j][1]:
            ans+=1
            a2[n-1-j][0]=2*n

print(ans)

Fixed code:
n=int(input())

a=[]
for i in range(n):
    x,y=map(int,input().split())
    a.append([x,y])

b=[]
for i in range(n):
    x,y=map(int,input().split())
    b.append([x,y])


a2=sorted(a, key=lambda x: x[1])
b2=sorted(b, key=lambda x: x[0])

ans=0
for i in range(n):
    for j in range(n):
        if b2[i][0]>a2[n-1-j][0] and b2[i][1]>a2[n-1-j][1]:
            ans+=1
            a2[n-1-j][0]=3*n
            break

print(ans)
Buggy code:
n=int(input())
x=sorted([tuple(map(int,input().split()))for i in range(n)])[::-1]
y=sorted([tuple(map(int,input().split()))for i in range(n)])[::-1]
#print(x,y)
ans=0
for i in range(n):
    for j in range(n):
        s,t=y[i]
        p,q=x[i]
        if p<s and q<t:
#            print(p,q,s,t)
            ans+=1
            break
print(ans)

Fixed code:
n=int(input())
x=sorted([tuple(map(int,input().split()))for i in range(n)],key=lambda x:x[1])[::-1]
y=sorted([tuple(map(int,input().split()))for i in range(n)])
#print(x)
#print(y)
ans=0
for j in x.copy():
    for i in y.copy():
        s,t=i
        p,q=j
        if p<s and q<t:
            y.remove((s,t))
            x.remove((p,q))
            #print(p,q,s,t)
            ans+=1
            break
    #print(x,y)
print(ans)
Buggy code:
N = int(input())

red_points = [[int(i) for i in input().split()] for j in range(N)]

blue_points = [[int(i) for i in input().split()] for j in range(N)]

red_points.sort()
blue_points.sort()
count = 0
distance = 9999
for blue_point in blue_points:
    for red_point in red_points:
        if (blue_point[0] > red_point[0]) and (blue_point[1] > red_point[1]):
            if blue_point[1] - red_point[1] < distance:
                distance = blue_point[1] - red_point[1]
                tmp = red_point
    if tmp in red_points:
        red_points.remove(tmp)
        tmp.clear()
        count = count + 1
    distance = 9999
print(count)


Fixed code:
N = int(input())

red_points = [[int(i) for i in input().split()] for j in range(N)]

blue_points = [[int(i) for i in input().split()] for j in range(N)]

red_points.sort()
blue_points.sort()
count = 0
distance = 9999
for blue_point in blue_points:
    tmp = [i for i in red_points if blue_point[0] > i[0] and blue_point[1] > i[1]]
    if tmp:
        for j in tmp:
            if (blue_point[1] - j[1]) < distance:
                distance = blue_point[1] - j[1]
                min_red = j
        count = count + 1
        red_points.remove(min_red)
        distance = 9999

print(count)
Buggy code:
N = int(input())
red = sorted([list(map(int, input().split())) for _ in range(N)], key=lambda x:x[1], reverse=True)
blue = sorted([list(map(int, input().split())) for _ in range(N)])

cnt = 0
for i in blue:
    for j in red:
        if i[0] > j[0] and i[1] > j[1]:
            cnt += 1
            red.remove(j)

print(cnt)

Fixed code:
N = int(input())
red = sorted([list(map(int, input().split())) for _ in range(N)], key=lambda x:x[1], reverse=True)
blue = sorted([list(map(int, input().split())) for _ in range(N)])

cnt = 0
for i in blue:
    for j in red:
        if i[0] > j[0] and i[1] > j[1]:
            cnt += 1
            red.remove(j)
            break

print(cnt)
Buggy code:
N = int(input())
reds = []
for i in range(N):
    reds.append(tuple(map(int, input().split(" "))))
blues = []
for i in range(N):
    blues.append(tuple(map(int, input().split(" "))))
reds.sort(key=lambda x: x.reverse(), reverse=True)
blues.sort()
picked = [False for _ in range(N)]
ans = 0
for blue in blues:
    for i, red in enumerate(reds):
        if blue[0] > red[0] and blue[1] > red[1] and not picked:
            ans += 1
            picked[i] = True
            break
print(ans)

Fixed code:
from pprint import pprint
N = int(input())
reds = []
for i in range(N):
    reds.append(tuple(map(int, input().split(" "))))
blues = []
for i in range(N):
    blues.append(tuple(map(int, input().split(" "))))
reds.sort(key=lambda x: (x[1], x[0]), reverse=True)
blues.sort()
picked = [False for _ in range(N)]
ans = 0
for blue in blues:
    for i, red in enumerate(reds):
        if blue[0] > red[0] and blue[1] > red[1] and not picked[i]:
            ans += 1
            picked[i] = True
            break
print(ans)
Buggy code:

n = int(input().strip())
red = [list(map(int, input().split())) for i in range(n)]
blue = [list(map(int, input().split())) for j in range(n)]

for i in range(n):
    '''
    kagi_r = [min(red[i][0], red[i][1]), max(red[i][0], red[i][1])]
    kagi_b = [min(blue[i][0], blue[i][1]), max(blue[i][0], blue[i][1])]
    red[i] = red[i] + kagi_r
    blue[i] = blue[i] + kagi_b
    '''
red.sort(key=lambda x: (x[0], x[1]), reverse=True)
blue.sort(key=lambda x: (x[0], x[1]))
flg_r = [0]*n
cnt = 0

for i in range(n):
    for j in range(n):
        if flg_r[j]:
            continue
        if red[j][0] < blue[i][0] and red[j][1] < blue[i][1]:
            flg_a[j] = 1
            cnt += 1
            break

print(cnt)

Fixed code:

n = int(input().strip())
red = [list(map(int, input().split())) for i in range(n)]
blue = [list(map(int, input().split())) for j in range(n)]

for i in range(n):
    '''
    kagi_r = [min(red[i][0], red[i][1]), max(red[i][0], red[i][1])]
    kagi_b = [min(blue[i][0], blue[i][1]), max(blue[i][0], blue[i][1])]
    red[i] = red[i] + kagi_r
    blue[i] = blue[i] + kagi_b
    '''
red.sort(key=lambda x: (x[0], x[1]), reverse=True)
blue.sort(key=lambda x: x[1])
flg_r = [0]*n
cnt = 0

for i in range(n):
    for j in range(n):
        if flg_r[j]:
            continue
        if red[j][0] < blue[i][0] and red[j][1] < blue[i][1]:
            flg_r[j] = 1
            cnt += 1
            break

print(cnt)
Buggy code:
N = int(input())
pointR = []
pointB = []
for i in range(N):
    pointR.append(list(map(int, input().split())))
for i in range(N):
    pointB.append(list(map(int, input().split())))
pointR.sort(key = lambda t: t[0])
pointB.sort(key = lambda t: t[0])
ans = 0

Bok = [True] * N

for i in range(N):
    for j in range(N):
        if Bok[j]:
            if pointR[i][0] < pointB[j][0] and pointR[i][1] < pointB[j][1]:
                ans += 1
                Bok[j] = False
                break
print(ans)

Fixed code:
N = int(input())
pointR = []
pointB = []
for i in range(N):
    pointR.append(list(map(int, input().split())))
for i in range(N):
    pointB.append(list(map(int, input().split())))
pointR.sort(key = lambda t: t[0], reverse = True)
pointB.sort(key = lambda t: t[1])
ans = 0

Aok = [True] * N
Bok = [True] * N

for i in range(N):
    for j in range(N):
        if Aok[j] and Bok[i]:
            if pointR[j][0] < pointB[i][0] and pointR[j][1] < pointB[i][1]:
                ans += 1
                Aok[j] = False
                Bok[i] = False
                break
print(ans)
Buggy code:
from operator import itemgetter
n=int(input())
A=[tuple(map(int,input().split())) for i in range(n)]
B=[tuple(map(int,input().split())) for j in range(n)]
count=0
for i in range(n):
    box=[A[i] for i in range(len(A)) if (A[i][0]<B[i][0]) and (A[i][1]<B[i][1])]
    if any(box):
        box=sorted(box, key=itemgetter(1))
        A.remove(box[-1])
        count +=1
print(count)

Fixed code:
from operator import itemgetter
n=int(input())
A=[tuple(map(int,input().split())) for i in range(n)]
B=[tuple(map(int,input().split())) for j in range(n)]
A.sort()
B.sort()
count=0
for i in range(n):
    box=[A[j] for j in range(len(A)) if (A[j][0]<B[i][0]) and (A[j][1]<B[i][1])]
    if any(box):
        box=sorted(box, key=itemgetter(1))
        A.remove(box[-1])
        count +=1
print(count)
Buggy code:
red_p = []
blue_p = []
count = 0
n = int(input())
for i in range(n):
    a_ad, b_ad = map(int, input().split())
    red_p.append((a_ad, b_ad))
for i in range(n):
    c_ad, d_ad = map(int, input().split())
    blue_p.append((c_ad, d_ad))
red_p.sort(key = lambda x: x[1])
blue_p.sort()
for i in range(n):
    l = len(red_p)
    for k in range(l):
        if red_p[k][0] < blue_p[i][0] and red_p[k][1] < blue_p[i][1]:
            count += 1
            red_p = red_p[:k] + red_p[k+1:]
            break
print(count)


Fixed code:
red_p = []
blue_p = []
count = 0
n = int(input())
for i in range(n):
    a_ad, b_ad = map(int, input().split())
    red_p.append((a_ad, b_ad))
for i in range(n):
    c_ad, d_ad = map(int, input().split())
    blue_p.append((c_ad, d_ad))
red_p.sort(key = lambda x: x[1], reverse = True)
blue_p.sort()
for i in range(n):
    l = len(red_p)
    for k in range(l):
        if red_p[k][1] < blue_p[i][1] and red_p[k][0] < blue_p[i][0]:
            count += 1
            red_p = red_p[:k] + red_p[k+1:]
            break
print(count)
Buggy code:
N= int(input())
ab = [list(map(int,input().split())) for i in range(N)]
cd = [list(map(int,input().split())) for i in range(N)]
alr = [False for i in range(N)]
ab.sort()
cd.sort()
count = 0
for c,d in cd:
    maxi = -1
    for i in range(N):
        if alr[i]:
            continue
        a,b = ab[i][0],ab[i][1]
        if a < c:
            if b < d:
                maxi = max(maxi,i)
        else:
            break
    if maxi != -1:
        alr[maxi] = True
print(alr.count(True))

Fixed code:
N= int(input())
ab = [list(map(int,input().split())) for i in range(N)]
cd = [list(map(int,input().split())) for i in range(N)]
alr = [False for i in range(N)]
ab.sort()
cd.sort()
count = 0
for c,d in cd:
    maxi = -1
    maxb = -1
    for i in range(N):
        if alr[i]:
            continue
        a,b = ab[i][0],ab[i][1]
        if a < c:
            if b < d:
                if maxb < b:
                    maxb = b
                    maxi = i
        else:
            break
    if maxi != -1:
        alr[maxi] = True
print(alr.count(True))
Buggy code:
n = int(input())
ans = 0
red = sorted([list(map(int, input().split())) for _ in range(n)], key=lambda x:-x[0])
blue = sorted([list(map(int, input().split())) for _ in range(n)])
for i in red:
    for num, j in enumerate(blue):
        if i[0] < j[0] and i[1] < j[1]:
            ans += 1
            del blue[num]
            break
print(ans)

Fixed code:
n = int(input())
ans = 0
red = sorted([list(map(int, input().split())) for _ in range(n)], key=lambda x:-x[1])
blue = sorted([list(map(int, input().split())) for _ in range(n)])
for i in red:
    for num, j in enumerate(blue):
        if i[0] < j[0] and i[1] < j[1]:
            ans += 1
            del blue[num]
            break
print(ans)
Buggy code:
n = int(input())
a = [list(map(int, input().split())) for i in range(n)]
b = [list(map(int, input().split())) for i in range(n)]

a.sort(reverse=True)
b.sort()
idxb = list()
for i in range(n):
    idx = -1
    maxy = -1
    for j in range(n):
        if not j in idxb:
            if a[i][0] < b[j][0] and maxy < a[i][1] < b[j][1] :
                maxy = a[i][1]
                idx = j
    if idx != -1:
        idxb.append(idx)

print(len(idxb))





Fixed code:
n = int(input())
a = [list(map(int, input().split())) for i in range(n)]
b = [list(map(int, input().split())) for i in range(n)]

a.sort(reverse=True)
b.sort()
idxb = list()
for i in range(n):
    idx = -1
    maxy = -1
    for j in range(n):
        if not j in idxb:
            if a[j][0] < b[i][0] and maxy < a[j][1] < b[i][1] :
                maxy = a[j][1]
                idx = j
    if idx != -1:
        idxb.append(idx)

print(len(idxb))
Buggy code:
N = int(input())
R = [list(map(int,input().split())) for i in range(N)]
B = [list(map(int,input().split())) for i in range(N)]
R.sort(key = lambda x:x[1], reverse=False)
B.sort(key = lambda x:x[0], reverse=False)
ans = 0
for b in B:
    for r in R:
        if r[0] < b[0] and r[1] < b[1]:
            ans += 1
            R.remove(r)
            break
print(ans)

Fixed code:
N = int(input())
R = [list(map(int,input().split())) for i in range(N)]
B = [list(map(int,input().split())) for i in range(N)]
R.sort(key = lambda x:x[1], reverse=True)
B.sort(key = lambda x:x[0], reverse=False)
ans = 0
for b in B:
    for r in R:
        if r[0] < b[0] and r[1] < b[1]:
            ans += 1
            R.remove(r)
            break
print(ans)
Buggy code:
def main():
    a1 = input().split()[0]
    a2 = input().split()[1]
    a3 = input().split()[2]

    print (a1+a2+a3)


if __name__ == "__main__":
    # global stime
    # stime = time.clock()
    main()



Fixed code:

def main():
    a1 = input()[0]
    a2 = input()[1]
    a3 = input()[2]

    print (a1+a2+a3)


if __name__ == "__main__":
    # global stime
    # stime = time.clock()
    main()
Buggy code:
#!/usr/bin/env python3
#%% for atcoder uniittest use
import sys
input= lambda: sys.stdin.readline().rstrip()
def pin(type=int):return map(type,input().split())
def tupin(t=int):return tuple(pin(t))
#%%code
def resolve():
    ans=""
    for i in range(3):
        ans+=input()[i]
    print(ans)

Fixed code:
#!/usr/bin/env python3
#%% for atcoder uniittest use
import sys
input= lambda: sys.stdin.readline().rstrip()
def pin(type=int):return map(type,input().split())
def tupin(t=int):return tuple(pin(t))
#%%code
def resolve():
    ans=""
    for i in range(3):
        ans+=input()[i]
    print(ans)
#%%submit!
resolve()
Buggy code:
a = input()
b = input()
c = input()

A = [0]*3
ca = 0
cb = 0
cc = 0
for d in a:
    ca +=1
    if(ca == 1):
        A[0] = d

for e in b:
    cb +=1
    if(cb == 1):
        A[1] = e
for f in c:
    cc +=1
    if(cc == 1):
        A[2] = f 

print(A[0]+A[1]+A[2])

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

A = [0]*3
ca = 0
cb = 0
cc = 0
for d in a:
    ca +=1
    if(ca == 1):
        A[0] = d

for e in b:
    cb +=1
    if(cb == 2):
        A[1] = e
for f in c:
    cc +=1
    if(cc == 3):
        A[2] = f 

print(A[0]+A[1]+A[2])
Buggy code:
c = list() 
for i in range(3):
	c.append(input(i))
#print(c)
print(c[0][0]+c[1][1]+c[2][2])


Fixed code:
c = list() 
for i in range(3):
	c.append(input())
#print(c)
print(c[0][0]+c[1][1]+c[2][2])
Buggy code:
nput()
one_list=list(a)
b=input()
two_list=list(b)
c=input()
three_list=list(c)
print('{0}{1}{2}'.format(a[0],b[1],c[2]))

Fixed code:
a=input()
one_list=list(a)
b=input()
two_list=list(b)
c=input()
three_list=list(c)
print('{0}{1}{2}'.format(a[0],b[1],c[2]))
Buggy code:
data = [[i for i in input().split()] for i in range(3)]
num = 0
for i in data:
	for j in i:
		print(j[num])
		num+=1

Fixed code:
data = [[i for i in input().split()] for i in range(3)]
num = 0
answer = ""
for i in data:
	for j in i:
		answer+=j[num]
		num+=1

print(answer)
Buggy code:
s=[]
for i in range(3):
  s+=input()[i]
print(s)

Fixed code:
s=""
for i in range(3):
  s+=input()[i]
print(s)
Buggy code:
A,B,C = [input() for i in range(3)]
a = [A[:1], A[1:2], A[2:]]
b = [B[:1], B[1:2], B[2:]]
c = [C[:1], C[1:2], C[2:]]
print(a.pop(0), b.pop(1), c.pop(2))

Fixed code:
A,B,C = [input() for i in range(3)]
a = [A[:1], A[1:2], A[2:]]
b = [B[:1], B[1:2], B[2:]]
c = [C[:1], C[1:2], C[2:]]
print(a.pop(0) + b.pop(1) + c.pop(2))
Buggy code:
s1 = input()
s2 = input()
s3 = input()
print(s1[0][0],s2[1][1],s3[2][2], sep="")

Fixed code:
s1 = input()
s2 = input()
s3 = input()
print(s1[0],s2[1],s3[2], sep="")
Buggy code:
c1=input()
c2=input()
c3=input()
print(c1[0]+c2[1]+c3[2

Fixed code:
c1=input()
c2=input()
c3=input()

s=c1[0]+c2[1]+c3[2]
print(s)
Buggy code:
c = input()
c2 = input()
c3 = input()
print(c[0]+c[1]+c[2])

Fixed code:
c = input()
c2 = input()
c3 = input()
print(c[0]+c2[1]+c3[2])
Buggy code:
a = int(input())
b = int(input())
c = int(input())
print(a[0] + b[1] + c[2])

Fixed code:
a = input()[0]
b = input()[1]
c = input()[2]
  
print(a+b+c)
Buggy code:
a=input().strip()
b=input().strip()
c=input().strip()
print("".join([a[0],b[1],c[0]])

Fixed code:
a=input().strip()
b=input().strip()
c=input().strip()
print("".join([a[0],b[1],c[2]]))
Buggy code:
A = input()
B = input()
C = input()

print(N[0] + N[1] + N[2])


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

print(A[0] + B[1] + C[2])
Buggy code:
a = []
for i in range(3):
  a[i] = input().split()
print(a[0][0]+a[1][1]+a[2][2])

Fixed code:
a = []
for i in range(3):
  a.append(input())
print(a[0][0]+a[1][1]+a[2][2])
Buggy code:
import functools

import os

INF = float('inf')


def inp():
    return int(input())


def inpf():
    return float(input())


def inps():
    return input()


def inl():
    return list(map(int, input().split()))


def inlf():
    return list(map(float, input().split()))


def inls():
    return input().split()


def debug(fn):
    if not os.getenv('LOCAL'):
        return fn

    @functools.wraps(fn)
    def wrapper(*args, **kwargs):
        print('DEBUG: {}({}) -> '.format(
            fn.__name__,
            ', '.join(
                list(map(str, args)) +
                ['{}={}'.format(k, str(v)) for k, v in kwargs.items()]
            )
        ), end='')
        ret = fn(*args, **kwargs)
        print(ret)
        return ret

    return wrapper


a = inls()
b = inls()
c = inls()
print(a[0] + b[1] + c[2])

Fixed code:
import functools

import os

INF = float('inf')


def inp():
    return int(input())


def inpf():
    return float(input())


def inps():
    return input()


def inl():
    return list(map(int, input().split()))


def inlf():
    return list(map(float, input().split()))


def inls():
    return input().split()


def debug(fn):
    if not os.getenv('LOCAL'):
        return fn

    @functools.wraps(fn)
    def wrapper(*args, **kwargs):
        print('DEBUG: {}({}) -> '.format(
            fn.__name__,
            ', '.join(
                list(map(str, args)) +
                ['{}={}'.format(k, str(v)) for k, v in kwargs.items()]
            )
        ), end='')
        ret = fn(*args, **kwargs)
        print(ret)
        return ret

    return wrapper


a = inps()
b = inps()
c = inps()
print(a[0] + b[1] + c[2])
Buggy code:
C1 = list(input())
C2 = list(input())
C3 = list(imput())

print(C1[0]+C2[1]+C3[2])

Fixed code:
C1 = list(input())
C2 = list(input())
C3 = list(input())

print(C1[0]+C2[1]+C3[2])
Buggy code:
S1=str(input())
S2=str(input())
S3=str(input())
print(S1[0]+S1[1]+S2[2])

Fixed code:
S1=str(input())
S2=str(input())
S3=str(input())
print(S1[0]+S2[1]+S3[2])
Buggy code:
C=[]
for i in range(3):
  C += list(input())
print(C[0][0]+C[1][1]+C[2][2])

Fixed code:
C=[]
for i in range(3):
  C.append(list(input()))
print(C[0][0]+C[1][1]+C[2][2])
Buggy code:
c=[]
for i in range(3):
    ci=input()
    a.append(ci)
print(c[1][1]+c[2][2]+c[3][3])

Fixed code:
c=[]
for i in range(3):
    ci=input()
    c.append(ci)
print(c[0][0]+c[1][1]+c[2][2])
Buggy code:
# -*- coding: utf-8 -*-
S = str(input())
T = str(input())
U = str(input())
print("{}".format(S[0]+S[1]+S[2]))

Fixed code:
# -*- coding: utf-8 -*-
S = str(input())
T = str(input())
U = str(input())
print("{}".format(S[0]+T[1]+U[2]))
Buggy code:
a = list(map(str, input().split()))
b = list(map(str, input().split()))
c = list(map(str, input().split()))

print(a[0]+b[1]+c[2], end='')

Fixed code:
a = list(map(str, input()))
b = list(map(str, input()))
c = list(map(str, input()))

print(a[0]+b[1]+c[2], end='')
Buggy code:
a=""
for i in range(3):
  l=input().split()
  a=a+l[i]
print(a)

Fixed code:
a=""
for i in range(3):
  l=input().split()
  a=a+l[0][i]
print(a)
Buggy code:
import sys

i = 0
for l in sys.stdin():
  print(l[i], end='')
  i += 1
  

Fixed code:
import sys

i = 0
for l in sys.stdin:
    print(l[i], end='')
    i += 1

print('')
Buggy code:
for i in range(3):
  s=input()
  ans+=s[i]
print(ans)

Fixed code:
ans=""
for i in range(3):
  s=input()
  ans+=s[i]
print(ans)
Buggy code:
#90a
s=[input() for _ in range(3)]
print(s[0][0]+s[1][0]+s[2][0])

Fixed code:
#90a
s=[input() for _ in range(3)]
print(s[0][0]+s[1][1]+s[2][2])
Buggy code:
print open(0).read(11)[::5]

Fixed code:
print(open(0).read()[::5])
Buggy code:
list = [input() for i in range(3)]
print(list[0][0] + list[1][1] + list[2][2]

Fixed code:
list = [input() for i in range(3)]
print(list[0][0] + list[1][1] + list[2][2])
Buggy code:
c1, c2, c3 = map(list,map(int, [input() for i in range(3)]))
print(c1[0]+c2[1]+c3[2])

Fixed code:
c1, c2, c3 = map(list,map(str, [input() for i in range(3)]))
print(c1[0]+c2[1]+c3[2])
Buggy code:
x= input()
y=input()
z=input()
result=x[0]+y[1]+x[2]
print(result)


Fixed code:
x = input()
y = input()
z = input()
print(x[0]+y[1]+z[2])
Buggy code:
a,b,c=(input() for _ in range(2))
print('a[0]+b[1]+c[2]')

Fixed code:
a,b,c=(input() for _ in range(3))
print(a[0]+b[1]+c[2])