Bobo has a matrix A with n rows and n columns.
For submatrix with upper-left corner (x1,y1) and lower-right corner (x2,y2) (1≤x1≤x2≤n,1≤y1≤y2≤n), he defined its skewness S(x1,y1,x2,y2)=(∑x2i=x1∑y2j=y1Ai,j)3.
Bobo would like to know the sum of skewness of all submatrices modulo (109+7).
Input
The input contains zero or more test cases and is terminated by end-of-file. For each test case:
The first line contains an integer n.
The i-th of following n lines contains n integers Ai,1,Ai,2,…,Ai,n.
- 1≤n≤1000
- 0≤Ai,j≤109
- The number of test cases does not exceed 10.
Output
For each case, output an integer which denotes the sum.
Sample Input
2 0 1 1 0 3 0 1 0 1 1 0 1 0 1
Sample Output
14 448