qyliang/CodeNanoFix huggingface dataset:
# Buggy code:
N = int(input())
As = list(map(int, input().split()))

INF = 10 ** 15
dp = [[-INF] * N for _ in range(3)]
dp[0][0] = As[0]
dp[1][0] = As[1]
dp[0][1] = As[0]
dp[1][1] = As[1]

if N % 2 == 0:
    for i in range(2, N):
        dp[0][i] = dp[0][i-2] + As[i]
        dp[1][i] = max(dp[0][i-1], dp[1][i-2] + As[i])
else:
    for i in range(2, N):
        dp[0][i] = dp[0][i-2] + As[i]
        dp[1][i] = max(dp[0][i-1], dp[1][i-2] + As[i])
        dp[2][i] = max(dp[1][i-1], dp[2][i-2] + As[i])


print(max(dp[0][N-1], dp[1][N-1], dp[2][N-1]))



# Fixed code:
INF = 10 ** 15

N = int(input())
As = list(map(int, input().split()))
As.append(-INF)

INF = 10 ** 15
dp = [[-INF] * (N//2) for _ in range(3)]
dp[0][0] = As[0]
dp[1][0] = As[1]
dp[2][0] = As[2]

for i in range(1, N//2):
    dp[0][i] = dp[0][i-1] + As[2*i]
    dp[1][i] = max(dp[0][i-1], dp[1][i-1]) + As[2*i+1]
    dp[2][i] = max(dp[0][i-1], dp[1][i-1], dp[2][i-1]) + As[2*i+2]

if N % 2 == 0:
    print(max(dp[0][-1], dp[1][-1]))
else:
    print(max(dp[0][-1], dp[1][-1], dp[2][-1]))
# Buggy code:
n = int(input())
a = [int(num) for num in input().split()]
dp = [[0,0,0] for _ in range(n//2+1)]

#dp[0] = [a[0],a[1],a[2]]

for i in range(n//2):
    dp[i+1][0] = dp[i][0] + a[i*2]
    dp[i+1][1] = max(dp[i][1],dp[i][0]) + a[i*2+1]
    if n % 2 == 1:
        dp[i+1][2] = max(dp[i][2],dp[i][1],dp[i][0]) + a[i*2+2]
print(dp)
print(max(dp[-1]))



# Fixed code:
n = int(input())
a = [int(num) for num in input().split()]
dp = [[0,0,0] for _ in range(n//2+1)]

#dp[0] = [a[0],a[1],a[2]]

for i in range(n//2):
    dp[i+1][0] = dp[i][0] + a[i*2]
    dp[i+1][1] = max(dp[i][1],dp[i][0]) + a[i*2+1]
    if n % 2 == 1:
        dp[i+1][2] = max(dp[i][2],dp[i][1],dp[i][0]) + a[i*2+2]
#print(dp)
if n% 2 == 1:
    print(max(dp[-1]))
else:
    print(max(dp[-1][:2]))