human
What is a Python program to find the maximum possible circular value after some sequences of operations given the following:
Danny, the local Math Maniac, is fascinated by circles, Omkar's most recent creation. Help him solve this circle problem!

You are given n nonnegative integers a_1, a_2, ..., a_n arranged in a circle, where n must be odd (ie. n-1 is divisible by 2). Formally, for all i such that 2 ≤ i ≤ n, the elements a_{i - 1} and a_i are considered to be adjacent, and a_n and a_1 are also considered to be adjacent. In one operation, you pick a number on the circle, replace it with the sum of the two elements adjacent to it, and then delete the two adjacent elements from the circle. This is repeated until only one number remains in the circle, which we call the circular value.

Help Danny find the maximum possible circular value after some sequences of operations. 

Input

The first line contains one odd integer n (1 ≤ n < 2 ⋅ 10^5, n is odd) — the initial size of the circle.

The second line contains n integers a_{1},a_{2},...,a_{n} (0 ≤ a_{i} ≤ 10^9) — the initial numbers in the circle.

Output

Output the maximum possible circular value after applying some sequence of operations to the given circle.

Examples

Input

3
7 10 2

Output

17

Input

1
4

Output

4

Note

For the first test case, here's how a circular value of 17 is obtained:

Pick the number at index 3. The sum of adjacent elements equals 17. Delete 7 and 10 from the circle and replace 2 with 17.

Note that the answer may not fit in a 32-bit integer.
The above is tricky. Write me a correct solution in PYTHON3.
assistant
#Here is Python program to find the maximum possible circular value after some sequences of operations.

# by the authority of GOD     author: manhar singh sachdev #

import os,sys
from io import BytesIO, IOBase

def main():
    n = int(input())
    arr = list(map(int,input().split()))
    if n == 1:
        print(arr[0])
        exit()
    cul_eve,cul_odd = [arr[0]],[0,0,0]
    x,y = arr[0],0
    for i in range(1,n):
        if i%2:
            y += arr[i]
            cul_eve.append(0)
            cul_odd.append(y)
        else:
            x += arr[i]
            cul_eve.append(x)
            cul_odd.append(0)
    ans = 0
    val = arr[0]
    for i in range(1,n):
        if i%2:
            ans = max(ans,val+cul_odd[-2]-cul_odd[i])
        else:
            val += arr[i]
    ans = max(ans,val)
    val = arr[1]
    for i in range(2,n):
        if i%2:
            val += arr[i]
        else:
            ans = max(ans,val+cul_eve[-1]-cul_eve[i-2])
    print(ans)

#Fast IO Region
BUFSIZE = 8192
class FastIO(IOBase):
    newlines = 0
    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None
    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()
    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()
    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)
class...