Determinant
题号:NC52847
时间限制:C/C++/Rust/Pascal 3秒,其他语言6秒
空间限制:C/C++/Rust/Pascal 32 M,其他语言64 M
Special Judge, 64bit IO Format: %lld

题目描述

Bobo learned the definition of determinant of matrix A in ICPCCamp. He also knew determinant can be computed in using Gaussian Elimination.
Bobo has an matrix B he would like to find modulo for all
where is the matrix after removing the i-th row and j-th column from B.
It is guaranteed that the each column sum of B is a multiple of .

输入描述:

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 .
*
*
* The sum of n does not exceed 5000.

输出描述:

For each case, output n rows where the i-th row contains n integers  modulo .
示例1

输入

复制
2
0 1
0 1000000006

输出

复制
1000000006 0
1 0