import java.util.*;
import java.lang.*;
import java.io.*;
class Trimat {
int Size;
int[][] M;
public Trimat(int n, Scanner in) {
Size = n;
M = new int[Size][];
for (int k = 0; k < Size; k++) {
M[k] = new int[Size - k];
for (int j = 0; j < Size - k; j++)
M[k][j] = in.nextInt();
}
}
public Trimat(int n, int a) {
Size = n;
M = new int[Size][];
for (int k = 0; k < Size; k++) {
M[k] = new int[Size - k];
M[k][0] = a;
}
}
public void print() {
for (int k = 0; k < Size; k++) {
for (int j = 0; j < k; j++)
for (int j = 0; j < Size - k; j++)
System.
out.
format("%d\t", M
[k
][j
]); }
}
public Trimat add(Trimat B) {
Trimat C = new Trimat(Size, 0);
for (int k = 0; k < Size; k++)
for (int j = 0; j < Size - k; j++)
C.M[k][j] = M[k][j] + B.M[k][j];
return C;
}
public Trimat mul(Trimat B) {
Trimat C = new Trimat(Size, 0);
for (int k = 0; k < Size; k++)
for (int j = k; j < Size; j++)
for (int r = k; r <= j; r++)
C.M[k][j-k] += M[k][r-k] * B.M[r][j-r];
return C;
}
}
class Main
{
{
Scanner in
= new Scanner
(System.
in); int n = in.nextInt();
Trimat A = new Trimat(n, in), B = new Trimat(n, in);
Trimat I = new Trimat(n,1);
Trimat C = A.mul(I.add(B.mul(B)));
A.print();
B.print();
C.print();
}
}
aW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgpjbGFzcyBUcmltYXQgewoJaW50IFNpemU7CglpbnRbXVtdIE07CgkKCXB1YmxpYyBUcmltYXQoaW50IG4sIFNjYW5uZXIgaW4pIHsKCQlTaXplID0gbjsKCQlNID0gbmV3IGludFtTaXplXVtdOwoJCWZvciAoaW50IGsgPSAwOyBrIDwgU2l6ZTsgaysrKSB7CgkJCU1ba10gPSBuZXcgaW50W1NpemUgLSBrXTsKCQkJZm9yIChpbnQgaiA9IDA7IGogPCBTaXplIC0gazsgaisrKQoJCQkJTVtrXVtqXSA9IGluLm5leHRJbnQoK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