Antagonistic Game#5184

Antagonistic Game

1 second
64 megabytes
Very easy

On each cell of an 8 \times 8 chessboard, a non-negative integer is written. Two players take turns moving a king, which can only move to the right, upward, or diagonally upward-right. The king starts in the lower-left corner of the board. The game ends when the king reaches the upper-right corner. When a player moves the king to a new cell, they receive from the other player an amount of money equal to the number written in that cell.

Your task is to determine the value of the game, which is the total amount of money the first player will have at the end of the game if they play to maximize their gain and the second player plays to minimize it.

Input

The input consists of eight lines, each containing eight non-negative integers not exceeding . The number in the lower-left corner is always .

Output

Output a single number, which is the value of the game.

Examples

Example 1

Loading
Loading