Partial matrix sum#683

Partial matrix sum

1 second
128 megabytes
Easy

The matrix of integers a_{ij} is given, where 1 \leq i \leq n, 1 \leq j \leq m. For all , , compute the partial sums:

s_{i, j} = \sum_{k = 1}^{i} \sum_{t = 1}^{j} a_{k, t}

Input

The first line contains the matrix size and (1 \leq n, m \leq 1000). Then follows the matrix a_{ij} (1 \leq a_{ij} \leq 1000): each of the next lines contains integers.

Output

Print the matrix of partial sums s_{i, j}: rows, each containing integers.

Examples

Example 1

Loading
Loading