import java.util.*;
import java.lang.*;
import java.io.*;
class Matrix
{
{
Scanner in
= new Scanner
(System.
in); int n = in.nextInt();
double[][] a = new double[n][n], aa = new double[n][n], result1 = new double[n][n], result2 = new double[n][n];
for (int i = 0; i < a.length; i++)
{
for (int j = 0; j < a[i].length; j++)
{
a[i][j] = in.nextDouble();
aa[j][i] = a[i][j];
}
}
for (int i = 0; i < a.length; i ++)
{
for (int j = 0; j < a[i].length; j ++)
{
result1[i][j] = 0.5 * (a[i][j] + aa[i][j]);
result2[i][j] = 0.5 * (a[i][j] - aa[i][j]);
}
}
for (int i = 0; i < a.length; i++)
{
for (int j = 0; j < a[i].length; j++)
{
System.
out.
print(result1
[i
][j
] + " "); }
}
for (int i = 0; i < a.length; i ++)
{
for (int j = 0; j < a[i].length; j ++)
{
System.
out.
print(result2
[i
][j
] + " "); }
}
}
}
aW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgpjbGFzcyBNYXRyaXgKewoJcHVibGljIHN0YXRpYyB2b2lkIG1haW4gKFN0cmluZ1tdIGFyZ3MpIHRocm93cyBqYXZhLmxhbmcuRXhjZXB0aW9uCgl7CgkgICAgU2Nhbm5lciBpbiA9IG5ldyBTY2FubmVyKFN5c3RlbS5pbik7CgkJaW50IG4gPSBpbi5uZXh0SW50KCk7CgkgICAgZG91YmxlW11bXSBhID0gbmV3IGRvdWJsZVtuXVtuXSwgYWEgPSAgbmV3IGRvdWJsZVtuXVtuXSwgcmVzdWx0MSA9IG5ldyBkb3VibGVbbl1bbl0sIHJlc3VsdDIgPSBuZXcgZG91YmxlW25dW25dOwoJICAgIGZvciAoaW50IGkgPSAwOyBpIDwgYS5sZW5ndGg7IGkrKykKCSAgICB7CgkJCWZvciAoaW50IGogPSAwOyBqIDwgYVtpXS5sZW5ndGg7IGorKykKCQkJewoJCQkJYVtpXVtqXSA9IGluLm5leHREb3VibGUoKTsKCQkJCWFhW2pdW2ldID0gY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