#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  float array[170][170], a[170][170], b[170][170];
  scanf("%d", &n);
  for (long long i = 0; i < n; i++)
    for (long long j = 0; j < n; j++) scanf("%f", &array[i][j]);
  for (long long i = 0; i < n; i++)
    for (long long j = 0; j < n; j++)
      a[i][j] = (array[i][j] + array[j][i]) / 2,
      b[i][j] = array[i][j] - a[i][j];
  for (long long i = 0; i < n; i++)
    for (long long j = 0; j < n; j++)
      printf(j != n - 1 ? "%.8f " : "%.8f\n", a[i][j]);
  for (long long i = 0; i < n; i++)
    for (long long j = 0; j < n; j++)
      printf(j != n - 1 ? "%.8f " : "%.8f\n", b[i][j]);
  return 0;
}
