AT_abc438_d [ABC438D] Tail of Snake

Description

> Snuke is observing a snake and is curious about which parts are the head, body, and tail. He divided the snake into $ N $ blocks and evaluated the head-likeness, body-likeness, and tail-likeness of each block. Then, he decided to find the division that maximizes the sum of the likeness values. You are given length- $ N $ integer sequences $ A = (A_1, A_2, \ldots, A_N) $ , $ B = (B_1, B_2, \ldots, B_N) $ , and $ C = (C_1, C_2, \ldots, C_N) $ . Find the maximum possible value of $ \displaystyle\sum_{i = 1}^{x} A_i + \sum_{i = x + 1}^{y} B_i + \sum_{i = y + 1}^{N} C_i $ for a pair of integers $ (x, y) $ satisfying $ 1 \leq x < y < N $ .

Input Format

The input is given from Standard Input in the following format: > $ N $ $ A_1 $ $ A_2 $ $ \ldots $ $ A_N $ $ B_1 $ $ B_2 $ $ \ldots $ $ B_N $ $ C_1 $ $ C_2 $ $ \ldots $ $ C_N $

Output Format

Output the answer.

Explanation/Hint

### Sample Explanation 1 With $ (x, y) = (2, 3) $ , we have $ \displaystyle\sum_{i = 1}^{x} A_i + \sum_{i = x + 1}^{y} B_i + \sum_{i = y + 1}^{N} C_i = 1 + 4 + 4 + 4 + 3 = 16 $ . ### Constraints - $ 3 \leq N \leq 3 \times 10^5 $ - $ 1 \leq A_i, B_i, C_i \leq 10^6 $ - All input values are integers.