Buggy python submission (verdict: Runtime Error):
N=int(input())
a = list(map(int, input().split()))
a.sort(reverse=True)

for i in range(N):
  if i%2==1:
    S+=a[i]
  else:
    S-=a[i]
print(S)

Fixed submission:
N=int(input())
a = list(map(int, input().split()))
a.sort(reverse=True)
S=0
for i in range(N):
  if i%2==0:
    S+=a[i]
  else:
    S-=a[i]
print(S)

Buggy python submission (verdict: Runtime Error):
N=int(input())
a = list(map(int, input().split()))
a2= sorted(a,reverse=True)

for i in range(N):
  if i%2==1:
    S+=a2[i]
    a.remove(max(a))
  else:
    S-=a2[i]
print(S)

Fixed submission:
N=int(input())
a = list(map(int, input().split()))
a.sort(reverse=True)
S=0
for i in range(N):
  if i%2==0:
    S+=a[i]
  else:
    S-=a[i]
print(S)

Buggy python submission (verdict: Runtime Error):
N=int(input())
a = list(map(int, input().split()))
a2= sort(a,reverse=True)

for i in range(N):
  if i%2==1:
    S+=a2[i]
    a.remove(max(a))
  else:
    S-=a2[i]
print(S)

Fixed submission:
N=int(input())
a = list(map(int, input().split()))
a.sort(reverse=True)
S=0
for i in range(N):
  if i%2==0:
    S+=a[i]
  else:
    S-=a[i]
print(S)

Buggy python submission (verdict: Runtime Error):
N=int(input())
a = list(map(int, input().split()))

for i in range(N):
  if i%2==1:
    S+=max(a)
    a.remove(max(a))
  else:
    S-=max(a)
    a.remove(max(a))
print(S)

Fixed submission:
N=int(input())
a = list(map(int, input().split()))
a.sort(reverse=True)
S=0
for i in range(N):
  if i%2==0:
    S+=a[i]
  else:
    S-=a[i]
print(S)

Buggy python submission (verdict: Runtime Error):
N=int(input())
a = list(map(int, input().split()))

for i in range(N):
  if i%2=1:
    S+=max(a)
    a.remove(max(a))
  else:
    S-=max(a)
    a.remove(max(a))
print(S)

Fixed submission:
N=int(input())
a = list(map(int, input().split()))
a.sort(reverse=True)
S=0
for i in range(N):
  if i%2==0:
    S+=a[i]
  else:
    S-=a[i]
print(S)

Buggy python submission (verdict: Runtime Error):
N=int(input())
a=input().split()
a2=sorted(a,reverse=True)
b1=a2[1::2]
b2=a2[0::2]
alice=sum(b1)
bob=sum(b2)
print(alice-bob)

Fixed submission:
N=int(input())
a = list(map(int, input().split()))
a.sort(reverse=True)
S=0
for i in range(N):
  if i%2==0:
    S+=a[i]
  else:
    S-=a[i]
print(S)

Buggy python submission (verdict: Runtime Error):
N=int(input())
a=input().split()
a2=sorted(a,reverse=True)
alice=sum(a2[1::2])
bob=sum(a2[0::2])
print(alice-bob)

Fixed submission:
N=int(input())
a = list(map(int, input().split()))
a.sort(reverse=True)
S=0
for i in range(N):
  if i%2==0:
    S+=a[i]
  else:
    S-=a[i]
print(S)

Buggy python submission (verdict: Runtime Error):
N=int(input())
a=input().split()
alice=0
bob=0

a2=sorted(a,reverse=true)

alice=sum(a2[1::2])
bob=sum(a2[0::2])
print(alice-bob)

Fixed submission:
N=int(input())
a = list(map(int, input().split()))
a.sort(reverse=True)
S=0
for i in range(N):
  if i%2==0:
    S+=a[i]
  else:
    S-=a[i]
print(S)

Buggy python submission (verdict: Runtime Error):
N=int(input())
a=input().split()
alice=0
bob=0
while len(a) !=0:
  alice+=max(a)
  a.remove(max(a))
  if len(a) !=0:
    bob+=max(a)
    a.remove(max(a))
  else: break
print(alice-bob)

Fixed submission:
N=int(input())
a = list(map(int, input().split()))
a.sort(reverse=True)
S=0
for i in range(N):
  if i%2==0:
    S+=a[i]
  else:
    S-=a[i]
print(S)

Buggy python submission (verdict: Runtime Error):
N=int(input())
a=input().split()
alice=0
bob=0
while len(a) !=0:
  alice+=max(a)
  a.remove(max(a))
  bob+=max(a)
  a.remove(max(a))
print(alice-bob)

Fixed submission:
N=int(input())
a = list(map(int, input().split()))
a.sort(reverse=True)
S=0
for i in range(N):
  if i%2==0:
    S+=a[i]
  else:
    S-=a[i]
print(S)

Buggy python submission (verdict: Runtime Error):
N=int(input())
a=input().split()
alice=0
bob=0
while len(a) !=0:
  alice+=max(a)
  a.remove(max(a))
  bob+==max(a)
  a.remove(max(a))
print(alice-bob)

Fixed submission:
N=int(input())
a = list(map(int, input().split()))
a.sort(reverse=True)
S=0
for i in range(N):
  if i%2==0:
    S+=a[i]
  else:
    S-=a[i]
print(S)

Buggy python submission (verdict: Runtime Error):
N=int(input())
a=input().split()

while len(a) !=0:
  alice+=max(a)
  a.remove(max(a))
  bob+==max(a)
  a.remove(max(a))
print(alice-bob)

Fixed submission:
N=int(input())
a = list(map(int, input().split()))
a.sort(reverse=True)
S=0
for i in range(N):
  if i%2==0:
    S+=a[i]
  else:
    S-=a[i]
print(S)