#D5306. Route Calculator

    ID: 4411 Type: Default 2000ms 536MiB

Route Calculator

Route Calculator

You have a grid with HH rows and WW columns. H+WH + W is even. We denote the cell at the ii-th row from the top and the jj-th column from the left by (i,ji, j). In any cell (i,ji, j), an integer between 11 and 99 is written if i+ji+j is even, and either '+' or '*' is written if i+ji+j is odd.

You can get a mathematical expression by moving right or down H+W2H + W - 2 times from (1,11, 1) to (H,WH, W) and concatenating all the characters written in the cells you passed in order. Your task is to maximize the calculated value of the resulting mathematical expression by choosing an arbitrary path from (1,11, 1) to (H,WH, W). If the maximum value is 101510^{15} or less, print the value. Otherwise, print 1-1.

Input

The input consists of a single test case in the format below.

HH WW a1,1a_{1,1} ... a1,Wa_{1,W} ... aH,1a_{H,1} ... aH,Wa_{H,W}

The first line consists of two HH integers and WW (1H,W501 \leq H, W \leq 50). It is guaranteed that H+WH + W is even. The following HH lines represent the characters on the grid. ai,ja_{i,j} represents the character written in the cell (i,ji, j). In any cell (i,ji, j), an integer between 11 and 99 is written if i+ji+j is even, and either '+' or '*' is written if i+1i+1 is odd.

Output

Print the answer in one line.

Examples

Input

3 3 1+2 +9* 1*5

Output

46

Input

1 31 999999999999999*9

Output

-1

Input

5 5 2+2+1 +1+1+ 1+2+2 +1+1+ 1+1+2

Output

10

Input

9 7 8+948 52+3+ 1322 51+9+ 1+222 362* 77+65 5+72+ 3+3*6+8

Output

86408

inputFormat

Input

The input consists of a single test case in the format below.

HH WW a1,1a_{1,1} ... a1,Wa_{1,W} ... aH,1a_{H,1} ... aH,Wa_{H,W}

The first line consists of two HH integers and WW (1H,W501 \leq H, W \leq 50). It is guaranteed that H+WH + W is even. The following HH lines represent the characters on the grid. ai,ja_{i,j} represents the character written in the cell (i,ji, j). In any cell (i,ji, j), an integer between 11 and 99 is written if i+ji+j is even, and either '+' or '*' is written if i+1i+1 is odd.

outputFormat

Output

Print the answer in one line.

Examples

Input

3 3 1+2 +9* 1*5

Output

46

Input

1 31 999999999999999*9

Output

-1

Input

5 5 2+2+1 +1+1+ 1+2+2 +1+1+ 1+1+2

Output

10

Input

9 7 8+948 52+3+ 1322 51+9+ 1+222 362* 77+65 5+72+ 3+3*6+8

Output

86408

样例

5 5
2+2+1
+1+1+
1+2+2
+1+1+
1+1+2
10