Coach Moony wants the best team to represent their college in ICPC. He has $N$ students standing in a circle with certain rating $X_i$ on a competitive coding platform. It is an established fact that any coder with more rating on the platform is a better coder.      
Moony  wants to send his best $3$ coders based upon their rating. But all coders only want to have their friends in their team and every coder is friends with four other coders, adjacent two on left side in the circle, and adjacent two on right. So Moony comes up with a solution that team with maximum cumulative rating of all three members in a team shall be representing their college.
You need to give the cumulative score of the team that will be representing the college.

-----Input:-----
- First line will contain $T$, number of testcases. 
- First line of each test case contains a single integer $N$.
- Second  line of each test case takes $N$ integers, denoting rating of $ith$ coder.

-----Output:-----
For each testcase, output a single integer denoting cumulative rating  of the team.

-----Constraints-----
- $1 \leq T \leq 10$
- $7 \leq N \leq 10^5$ 
- $0 \leq X_i \leq 10^9$

-----Sample Input:-----
1

7

10 40 30 30 20 0 0  

-----Sample Output:-----
100

```python

USER_FILENAME = "<user_code>"
import sys, json, builtins
import math, heapq, bisect, itertools, functools, collections, statistics, fractions, decimal, operator, array, random, re, string, os, pathlib
try:
    import resource as _res
except Exception:
    _res = None
from collections import Counter, defaultdict, deque, OrderedDict
from functools import lru_cache, reduce
from itertools import accumulate, permutations, combinations, product
from math import gcd, ceil, floor, sqrt
from decimal import Decimal
try:
    from typing import *
except Exception:
    pass
try:
    sys.setrecursionlimit(1_000_000)
except Exception:
    pass
try:
    import site as _site
    try:
        _sys_sites = _site.getsitepackages() if hasattr(_site, "getsitepackages") else []
        for _p in _sys_sites:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
    try:
        _usp = _site.getusersitepackages()
        if isinstance(_usp, str):
            _usp = [_usp]
        for _p in _usp:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
except Exception:
    pass

ns = {"__name__": "__main__"}
for _k, _v in list(globals().items()):
    if not _k.startswith("_"):
        ns[_k] = _v
_CODE = "'''t = int(input())\nfor i in range(t):\n    n = int(input())\n    l = list(map(int, input().strip().split()))\n    if(n==3):\n        print(l[0]+l[1]+l[2])\n    elif(n==4):\n        print(sum(l)-min(l))\n    else:\n        ans=0\n        for i in range(n):\n            k = [0 for i in range(5)]\n            k[0]=l[i]\n            k[1]=l[(i+n+1)%n]\n            k[2] = l[(i+n+2)%n]\n            k[3] = l[i-1]\n            k[4] = l[i-2]\n            k.sort()\n            p = k[2]+k[3]+k[4]\n            if(p>ans):\n                ans=p\n        print(ans)'''\nt = int(input())\nfor i in range(t):\n    n = int(input())\n    l = list(map(int, input().strip().split()))\n    if(n==3):\n        print(sum(l))\n    else:\n        ans=0\n        for j in range(n):\n            p = l[j]+l[(j+n+1)%n]+l[(j+n+2)%n]\n            if(p>ans):\n                ans=p\n        p = l[n-2]+l[n-1]+l[0]\n        if(p>ans):\n            ans=p\n        p = l[1]+l[n-1]+l[0]\n        if(p>ans):\n            ans=p\n        print(ans)\n    \n            \n"
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 13347