Buggy python submission (verdict: Runtime Error):
def getNumNeg(L):
  return sum([i<0 for i in L])
  
def findmax2(L):
  numNeg = getNumNeg(L)
  absL = list(map(abs, L))
  if numNeg % 2 == 0:
    print(sum(absL))
  else:
    print(sum(absL)-min(absL))
        
n = int(input())
a = list(map(abs, input().split()))
findmax2(a)


Fixed submission:
def getNumNeg(L):
  return sum([i<0 for i in L])
  
def findmax2(L):
  numNeg = getNumNeg(L)
  absL = list(map(abs, L))
  if numNeg % 2 == 0:
    print(sum(absL))
  else:
    print(sum(absL)-2*min(absL))
        
n = int(input())
a = list(map(int, input().split()))
findmax2(a)

Buggy python submission (verdict: Runtime Error):
def getNumNeg(L):
    return sum([i<0 for i in L])
  
def findmax2(L):
    numNeg = getNumNeg(L)
    absL = list(map(abs, L))
    if numNeg % 2 == 0:
        print(sum(absL))
    else:
        print(sum(absL)-min(absL))
        
n = int(input())
a = list(map(abs, input().split()))
findmax2(a)

Fixed submission:
def getNumNeg(L):
  return sum([i<0 for i in L])
  
def findmax2(L):
  numNeg = getNumNeg(L)
  absL = list(map(abs, L))
  if numNeg % 2 == 0:
    print(sum(absL))
  else:
    print(sum(absL)-2*min(absL))
        
n = int(input())
a = list(map(int, input().split()))
findmax2(a)

Buggy python submission (verdict: Time Limit Exceeded):
def getNumNeg(L):
    return sum([i<0 for i in L])

def findmax(L):
    numNeg = getNumNeg(L)
    if numNeg % 2 == 0: # end-point: all positive
        while getNumNeg(L) != 0:
            i = L.index(min(L[:-1]))
            j = i + 1
            L[i] = L[i] * (-1)
            L[j] = L[j] * (-1)
        print(sum(L))
    else: # end-point: smallest abs(number) is negative
        absL = list(map(abs, L))
        stop = min(absL)*(-1)
        while (getNumNeg(L) != 1) or (min(L) != stop):
            i = L.index(min(L[:-1]))
            j = i + 1
            L[i] = L[i] * (-1)
            L[j] = L[j] * (-1)
        print(sum(L))

n = int(input())
a = list(map(int, input().split()))
findmax(a)


Fixed submission:
def getNumNeg(L):
  return sum([i<0 for i in L])
  
def findmax2(L):
  numNeg = getNumNeg(L)
  absL = list(map(abs, L))
  if numNeg % 2 == 0:
    print(sum(absL))
  else:
    print(sum(absL)-2*min(absL))
        
n = int(input())
a = list(map(int, input().split()))
findmax2(a)

Buggy python submission (verdict: Runtime Error):
def getNumNeg(L):
    return sum([i<0 for i in L])

def findmax(L):
    numNeg = getNumNeg(L)
    if numNeg % 2 == 0: # end-point: all positive
         while getNumNeg(L) != 0:
            i = L.index(min(L[:-1]))
            j = i + 1
            L[i] = L[i] * (-1)
            L[j] = L[j] * (-1)
        print(sum(L))
    else: # end-point: smallest abs(number) is negative
        absL = list(map(abs, L))
        stop = min(absL)*(-1)
        while (getNumNeg(L) != 1) or (min(L) != stop):
            i = L.index(min(L[:-1]))
            j = i + 1
            L[i] = L[i] * (-1)
            L[j] = L[j] * (-1)
        print(sum(L))

n = int(input())
a = list(map(int, input().split()))
findmax(a)


Fixed submission:
def getNumNeg(L):
  return sum([i<0 for i in L])
  
def findmax2(L):
  numNeg = getNumNeg(L)
  absL = list(map(abs, L))
  if numNeg % 2 == 0:
    print(sum(absL))
  else:
    print(sum(absL)-2*min(absL))
        
n = int(input())
a = list(map(int, input().split()))
findmax2(a)

Buggy python submission (verdict: Runtime Error):
def getNumNeg(L):
    return sum([i<0 for i in L])

def findmax(L):
    numNeg = getNumNeg(L)
    print(numNeg)
    if numNeg % 2 == 0: # end-point: all positive
         while getNumNeg(L) != 0:
            i = L.index(min(L[:-1]))
            j = i + 1
            L[i] = L[i] * (-1)
            L[j] = L[j] * (-1)
        print(sum(L))
    else: # end-point: smallest abs(number) is negative
        absL = list(map(abs, L))
        stop = min(absL)*(-1)
        while (getNumNeg(L) != 1) or (min(L) != stop):
            i = L.index(min(L[:-1]))
            j = i + 1
            L[i] = L[i] * (-1)
            L[j] = L[j] * (-1)
        print(sum(L))

n = int(input())
a = list(map(int, input().split()))
findmax(a)

Fixed submission:
def getNumNeg(L):
  return sum([i<0 for i in L])
  
def findmax2(L):
  numNeg = getNumNeg(L)
  absL = list(map(abs, L))
  if numNeg % 2 == 0:
    print(sum(absL))
  else:
    print(sum(absL)-2*min(absL))
        
n = int(input())
a = list(map(int, input().split()))
findmax2(a)

Buggy python submission (verdict: Runtime Error):
def getAbs(L):
  return list(map(abs, L))

n = int(input())
a = list(map(int, input().split()))

stop = min(getAbs(a))
while min(a) != stop*(-1):
  if a == getAbs(a):
    break
  i = a.index(min(a))
  j = i + 1
  a[i] = a[i] * (-1)
  a[j] = a[j] * (-1)
print(sum(a))

Fixed submission:
def getNumNeg(L):
  return sum([i<0 for i in L])
  
def findmax2(L):
  numNeg = getNumNeg(L)
  absL = list(map(abs, L))
  if numNeg % 2 == 0:
    print(sum(absL))
  else:
    print(sum(absL)-2*min(absL))
        
n = int(input())
a = list(map(int, input().split()))
findmax2(a)