#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, w[170][170], i, j;
  double a[170][170], b[170][170];
  scanf("%d", &n);
  for (i = 0; i < n; i++)
    for (j = 0; j < n; j++) cin >> w[i][j];
  for (i = 0; i < n; i++)
    for (j = 0; j < n; j++) a[i][j] = (double)(w[i][j] + w[j][i]) / 2;
  for (i = 0; i < n; i++)
    for (j = 0; j < n; j++) b[i][j] = (double)w[i][j] - a[i][j];
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) printf("%.6lf ", a[i][j]);
    printf("\n");
  }
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) printf("%.6lf ", b[i][j]);
    printf("\n");
  }
  return 0;
}
