Given an integer matrix a_{ij} of size n \times m, where 1 \leq i \leq n, 1 \leq j \leq m, compute the sum for the given indices l_x, l_y, r_x, r_y:
The first line contains two integers and m~(1 \le n, m \le 1000) — the dimensions of the matrix.
The next lines contain integers each, representing the elements of the matrix a_{ij}~(1 \le a_{ij} \le 1000).
The following line contains an integer q~(1 \le q \le 10^6) — the number of queries.
Each of the next lines contains four integers l_{x_i}, l_{y_i}, r_{x_i}, r_{y_i}~(1 \le l_{x_i} \le r_{x_i} \le n, 1 \le l_{y_i} \le r_{y_i} \le m) — the parameters of the query.
Print integers, one per line — the answers to the queries.
Example 1