Coin Row

No attempts yetTime limit1sMemory limit128 MB

Problem

A row of $n$ coins has positive integer values $c_1, c_2, \dots, c_n$ (not necessarily distinct). Select coins so that the total value collected is as large as possible, subject to the constraint that no two adjacent coins may be selected.

Input

The first line contains a positive integer $n$, the number of coin rows that follow. Each of the next $n$ lines describes one coin row as a list of positive integers separated by one or more spaces. A row contains at most 20 coins.

Output

For each coin row, print on its own line the maximum total value you can collect subject to the constraint that no two adjacent coins are selected. Print each answer as a plain positive integer with no extra formatting.