762_D. Maximum path
You are given a rectangular table 3 × n. Each cell contains an integer. You can move from one cell to another if they share a side.

Find such path from the upper left cell to the bottom right cell of the table that doesn't visit any of the cells twice, and the sum of numbers written in the cells of this path is maximum possible.

Input

The first line contains an integer n (1 ≤ n ≤ 105) — the number of columns in the table.

Next three lines contain n integers each — the description of the table. The j-th number in the i-th line corresponds to the cell aij ( - 109 ≤ aij ≤ 109) of the table.

Output

Output the maximum sum of numbers on a path from the upper left cell to the bottom right cell of the table, that doesn't visit any of the cells twice.

Examples

Input

3
1 1 1
1 -1 1
1 1 1


Output

7


Input

5
10 10 10 -1 -1
-1 10 10 10 10
-1 10 10 10 10


Output

110

Note

The path for the first example:

<image>

The path for the second example:

<image>
```python
import sys
from array import array  # noqa: F401
import typing as Tp  # noqa: F401


def input():
    return sys.stdin.buffer.readline().decode('utf-8')


def output(*args):
    sys.stdout.buffer.write(
        ('\n'.join(map(str, args)) + '\n').encode('utf-8')
    )


def main():
    n = int(input())
    a = [list(map(float, input().split())) for _ in range(3)]
    dp = [[[-1e18] * 2 for _ in range(3)] for _ in range(n + 1)]
    dp[0][0][0] = 0.0

    for i in range(n):
        for j in range(3):
            dp[i + 1][j][0] = max(dp[i + 1][j][0], dp[i][j][0] + a[j][i])
            if j > 0:
                dp[i + 1][j - 1][0] = max(dp[i + 1][j - 1][0], dp[i][j][0] + a[j][i] + a[j - 1][i])
            if j < 2:
                dp[i + 1][j + 1][0] = max(dp[i + 1][j + 1][0], dp[i][j][0] + a[j][i] + a[j + 1][i])

        dp[i + 1][0][1] = max(
            dp[i + 1][0][1],
            dp[i][0][0] + a[0][i] + a[1][i] + a[2][i],
            dp[i][0][1] + a[0][i] + a[1][i] + a[2][i]
        )

        dp[i + 1][2][0] = max(
            dp[i + 1][2][0],
            dp[i][0][0] + a[0][i] + a[1][i] + a[2][i],
            dp[i][0][1] + a[0][i] + a[1][i] + a[2][i]
        )

        dp[i + 1][2][1] = max(
            dp[i + 1][2][1],
            dp[i][2][0] + a[0][i] + a[1][i] + a[2][i],
            dp[i][2][1] + a[0][i] + a[1][i] + a[2][i]
        )

        dp[i + 1][0][0] = max(
            dp[i + 1][0][0],
            dp[i][2][0] + a[0][i] + a[1][i] + a[2][i],
            dp[i][2][1] + a[0][i] + a[1][i] + a[2][i]
        )

    print(round(dp[-1][2][0]))


if __name__ == '__main__':
    main()

```