On a two-dimensional plane, you are now at coordinate $(1, 1)$ and want to get to $(R, C)$, the coordinates of the UFO.
When you are at $(r, c)$, you can make the following four kinds of moves:
* Move from $(r, c)$ to $(r, c + 1)$ at the cost of $A_{r, c}$. You can make this move when $c < C$.
* Move from $(r, c)$ to $(r, c - 1)$ at the cost of $A_{r, c - 1}$. You can make this move when $c > 1$.
* Move from $(r, c)$ to $(r + 1, c)$ at the cost of $B_{r, c}$. You can make this move when $r < R$.
* Choose an integer $i$ such that $1 ≤ i < r$ and move from $(r, c)$ to $(r - i, c)$ at the cost of $1 + i$.
Find the minimum cost needed to move from $(1, 1)$ to $(R, C)$.
## Constraints
* All values in input are integers.
* $2 ≤ R, C ≤ 500$
* $0 ≤ A_{i,j} < 10^3$
* $0 ≤ B_{i,j} < 10^3$
## Input
Input is given from Standard Input in the following format:
$R$ $C$
$A_{1,1}$ $\cdots$ $A_{1,C-1}$
$\vdots$
$A_{R,1}$ $\cdots$ $A_{R,C-1}$
$B_{1,1}$ $\cdots$ $B_{1,C}$
$\vdots$
$B_{R-1,1}$ $\cdots$ $B_{R-1,C}$
[samples]