#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  double a[200][200];
  double b[200][200];
  double w[200][200];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cin >> w[i][j];
      a[i][j] = b[i][j] = 2000;
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      a[i][j] = (w[i][j] + w[j][i]) * 1.0 / 2;
      b[i][j] = (w[i][j] - w[j][i]) * 1.0 / 2;
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cout << fixed << setprecision(9) << a[i][j] << " ";
    }
    cout << "\n";
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cout << fixed << setprecision(9) << b[i][j] << " ";
    }
    cout << "\n";
  }
}
