You are given a W×H grid. Each cell contains an integer. The top-left cell is called (1,1), and the bottom-right cell is called (W,H).
A path from a cell S to a cell T is a sequence of cells such that the first cell in the sequence is S, the last cell in the sequence is T, and any two consecutive cells in the sequence share an edge. The cost of a path is defined as the sum of costs of all cells in the path.
You are given the integers written on the grid, and also Q pairs of cells (SX_i,SY_i), (TX_i,TY_i). For each pair, compute the minimum cost of the path from the cell (SX_i,SY_i) to the cell (TX_i,TY_i).
On the first line, you are given three integers W, H, and Q (1≤W≤10, 2≤H≤104, 1≤Q≤105).
On the next H lines, you are given the information about the grid. The x-th number in the y-th of these lines, A_x,y, is the integer written in the cell (x,y) (0≤A_x,y≤109).
On the next Q lines, you are given pairs of cells (SX_i,SY_i), (TX_i,TY_i) (1≤SX_i,TX_i≤W, 1≤SY_i,TY_i≤H, (SX_i,SY_i)=(TX_i,TY_i)).
Print Q lines. On the i-th line, print the answer for the pair (SX_i,SY_i) and (TX_i,TY_i).