Buggy python submission (verdict: Runtime Error):
n = int(input())
if n==1:
  print(int(input()))
else:
  ab = [[0] * n for i in range(3)]
  for i in range(n):
    ab[0][i], ab[1][i] = map(int, input().split())
    ab[2][i] = ab[0][i] + ab[1][i]
  sorted(ab, key=lambda x: x[2])
  print(sum(ab[0][0::2])-sum(ab[1][1::2]))


Fixed submission:
# C
n = int(input())
if n==1:
    a, b =map(int, input().split())
    print(a)
else:
    def return_a(n):
        return n[0]
    def return_b(n):
        return n[1]
    ab = [[0] * 3 for i in range(n)]
    for i in range(n):
        ab[i][0], ab[i][1] = map(int, input().split())
        ab[i][2] = ab[i][0] + ab[i][1]
    ab = sorted(ab, key=lambda x: x[2], reverse=True)
    print(sum(map(return_a, ab[0::2])) - sum(map(return_b, ab[1::2])))

Buggy python submission (verdict: Runtime Error):
n = int(input())
if n==1:
  print(int(input())
else:
  ab = [[0] * n for i in range(3)]
  for i in range(n):
    ab[0][i], ab[1][i] = map(int, input().split())
    ab[2][i] = ab[0][i] + ab[1][i]
  sorted(ab, key=lambda x: x[2])
  print(sum(ab[0][0::2])-sum(ab[1][1::2]))


Fixed submission:
# C
n = int(input())
if n==1:
    a, b =map(int, input().split())
    print(a)
else:
    def return_a(n):
        return n[0]
    def return_b(n):
        return n[1]
    ab = [[0] * 3 for i in range(n)]
    for i in range(n):
        ab[i][0], ab[i][1] = map(int, input().split())
        ab[i][2] = ab[i][0] + ab[i][1]
    ab = sorted(ab, key=lambda x: x[2], reverse=True)
    print(sum(map(return_a, ab[0::2])) - sum(map(return_b, ab[1::2])))

Buggy python submission (verdict: Runtime Error):
n = int(input())
ab = [[0] * n for i in range(3)]
for i in range(n):
  ab[0][i], ab[1][i] = map(int, input().split())
  ab[2][i] = ab[0][i] + ab[1][i]
sorted(ab, key=lambda x: x[2])
print(sum(ab[0][0::2])-sum(ab[1][1::2]))


Fixed submission:
# C
n = int(input())
if n==1:
    a, b =map(int, input().split())
    print(a)
else:
    def return_a(n):
        return n[0]
    def return_b(n):
        return n[1]
    ab = [[0] * 3 for i in range(n)]
    for i in range(n):
        ab[i][0], ab[i][1] = map(int, input().split())
        ab[i][2] = ab[i][0] + ab[i][1]
    ab = sorted(ab, key=lambda x: x[2], reverse=True)
    print(sum(map(return_a, ab[0::2])) - sum(map(return_b, ab[1::2])))

Buggy python submission (verdict: Runtime Error):
n = int(input())
ab = [[0] * 3 for i in range(n)]
for i in range(n):
  ab[i][0], ab[i][1] = map(int, input().split())
  ab[i][2] = ab[i][0] + ab[i][1]
sorted(ab, key=lambda x: x[2])
print(sum(ab[0::2][0])-sum(ab[1::2][1]))


Fixed submission:
# C
n = int(input())
if n==1:
    a, b =map(int, input().split())
    print(a)
else:
    def return_a(n):
        return n[0]
    def return_b(n):
        return n[1]
    ab = [[0] * 3 for i in range(n)]
    for i in range(n):
        ab[i][0], ab[i][1] = map(int, input().split())
        ab[i][2] = ab[i][0] + ab[i][1]
    ab = sorted(ab, key=lambda x: x[2], reverse=True)
    print(sum(map(return_a, ab[0::2])) - sum(map(return_b, ab[1::2])))

Buggy python submission (verdict: Runtime Error):
n = int(input())
for i in range(n):
  ab[i][0], ab[i][1] = map(int, input().split())
  ab[i][2] = ab[i][0] + ab[i][1]
sorted(ab, key=lambda x: x[2])
print(sum(ab[0::2][0])-sum(ab[1::2][1]))

Fixed submission:
# C
n = int(input())
if n==1:
    a, b =map(int, input().split())
    print(a)
else:
    def return_a(n):
        return n[0]
    def return_b(n):
        return n[1]
    ab = [[0] * 3 for i in range(n)]
    for i in range(n):
        ab[i][0], ab[i][1] = map(int, input().split())
        ab[i][2] = ab[i][0] + ab[i][1]
    ab = sorted(ab, key=lambda x: x[2], reverse=True)
    print(sum(map(return_a, ab[0::2])) - sum(map(return_b, ab[1::2])))