#include <bits/stdc++.h>
double arr[2][170][170];
int top = 0, w[170][170];
int main() {
  int n, i, j, k;
  double t;
  scanf("%d", &n);
  for (i = 0; i < n; i++)
    for (j = 0; j < n; j++) scanf("%d", &w[i][j]);
  for (i = 0; i < n; i++) arr[0][i][i] = w[i][i];
  for (j = 0; j < n; j++)
    for (i = 0; i < n; i++) {
      t = ((double)(w[i][j] + w[j][i])) / 2;
      arr[0][i][j] = arr[0][j][i] = t;
      arr[1][i][j] = w[i][j] - arr[0][i][j];
      arr[1][j][i] = w[j][i] - arr[0][j][i];
    }
  for (k = 0; k < 2; k++)
    for (i = 0; i < n; i++, puts(""))
      for (j = 0; j < n; j++) printf("%lf ", arr[k][i][j]);
  return 0;
}
