We have $K$ sequences. The $i$\-th sequence $A_i$ has the length of $N_i$.
Takahashi and Aoki will play a game using these. They will alternately do the following operation until the length of every sequence becomes $1$:
* Choose a sequence of length at least $2$, and delete its first or last element.
Takahashi goes first. Takahashi wants to maximize the sum of the $K$ elements remaining in the end, while Aoki wants to minimize it.
Find the sum of the $K$ elements remaining in the end when both players play optimally.
## Constraints
* All values in input are integers.
* $1 \leq K \leq 2 \times 10^5$
* $1 \leq N_i$
* $\sum_i N_i \leq 2 \times 10^5$
* $1 \leq A_{i, j} \leq 10^9$
## Input
Input is given from Standard Input in the following format:
$K$
$N_1$ $A_{1, 1}$ $A_{1, 2}$ $\cdots$ $A_{1, N_1}$
$N_2$ $A_{2, 1}$ $A_{2, 2}$ $\cdots$ $A_{2, N_2}$
$\vdots$
$N_K$ $A_{K, 1}$ $A_{K, 2}$ $\cdots$ $A_{K, N_K}$
[samples]