Buggy python submission (verdict: Runtime Error):
 N = int(input())
 ab = sorted([ tuple(map(int, input().split())) for x in range(N)], key=lambda x:x[1], reverse=True)
 cd = sorted([ tuple(map(int, input().split())) for x in range(N)])
 resultx = []
 resulty = []
 for xb, yb in list(cd):
     for xr, yr in list(ab):
         if (xr, yr) in resultx:
             continue
         if xr < xb and yr < yb:
             resultx.append((xr,yr))
             resulty.append((xb,yb))
             break

 print(len(resultx))

Fixed submission:
N = int(input())
ab = sorted([ tuple(map(int, input().split())) for x in range(N)], key=lambda x:x[1],reverse=True)
cd = sorted([ tuple(map(int, input().split())) for x in range(N)])
resultx = []
resulty = []
for xb, yb in list(cd):
    for xr, yr in list(ab):
        if (xr, yr) in resultx:
            continue
        if xr < xb and yr < yb:
            resultx.append((xr,yr))
            resulty.append((xb,yb))
            break

print(len(resultx))

Buggy python submission (verdict: Runtime Error):
 N = int(input())
 ab = [tuple(map(int,input().split())) for i in range(N)]
 cd = [tuple(map(int,input().split())) for i in range(N)]
 result = []
 for i in range(N):
     xr , yr = ab[i]
     xb, yb = cd[i]
     if xr < xb or yr < yb:
         print(xr, yr, xb, yb)
         result.append('BINGO!!!')
 print(len(result))

Fixed submission:
N = int(input())
ab = sorted([ tuple(map(int, input().split())) for x in range(N)], key=lambda x:x[1],reverse=True)
cd = sorted([ tuple(map(int, input().split())) for x in range(N)])
resultx = []
resulty = []
for xb, yb in list(cd):
    for xr, yr in list(ab):
        if (xr, yr) in resultx:
            continue
        if xr < xb and yr < yb:
            resultx.append((xr,yr))
            resulty.append((xb,yb))
            break

print(len(resultx))

Buggy python submission (verdict: Runtime Error):
 N = int(input())
 ab = [tuple(map(int,input().split())) for i in range(N)]
 cd = [tuple(map(int,input().split())) for i in range(N)]
 result = []
 for i in range(N):
     xr , yr = ab[i]
     xb, yb = cd[i]
     if xr < xb or yr < yb:
        print(xr, yr, xb, yb)
        result.append('BINGO!!!')
 print(len(result))


Fixed submission:
N = int(input())
ab = sorted([ tuple(map(int, input().split())) for x in range(N)], key=lambda x:x[1],reverse=True)
cd = sorted([ tuple(map(int, input().split())) for x in range(N)])
resultx = []
resulty = []
for xb, yb in list(cd):
    for xr, yr in list(ab):
        if (xr, yr) in resultx:
            continue
        if xr < xb and yr < yb:
            resultx.append((xr,yr))
            resulty.append((xb,yb))
            break

print(len(resultx))

Buggy python submission (verdict: Runtime Error):
 N = int(input())
 ab = [tuple(map(int,input().split())) for i in range(N)]
 cd = [tuple(map(int,input().split())) for i in range(N)]
 result = []
 for i in range(N):
     xr , yr = ab[i]
     xb, yb = cd[i]
     if xr < xb and yr < yb:
         result.append('BINGO!!!')
 print(len(result))

Fixed submission:
N = int(input())
ab = sorted([ tuple(map(int, input().split())) for x in range(N)], key=lambda x:x[1],reverse=True)
cd = sorted([ tuple(map(int, input().split())) for x in range(N)])
resultx = []
resulty = []
for xb, yb in list(cd):
    for xr, yr in list(ab):
        if (xr, yr) in resultx:
            continue
        if xr < xb and yr < yb:
            resultx.append((xr,yr))
            resulty.append((xb,yb))
            break

print(len(resultx))