Problem: Chubby Yang is studying linear equations right now. He came up with a nice problem. In the problem you are given an n × n matrix W, consisting of integers, and you should find two n × n matrices A and B, all the following conditions must hold: 

  * Aij = Aji, for all i, j (1 ≤ i, j ≤ n); 
  * Bij = - Bji, for all i, j (1 ≤ i, j ≤ n); 
  * Wij = Aij + Bij, for all i, j (1 ≤ i, j ≤ n). 



Can you solve the problem?

Input

The first line contains an integer n (1 ≤ n ≤ 170). Each of the following n lines contains n integers. The j-th integer in the i-th line is Wij (0 ≤ |Wij| < 1717).

Output

The first n lines must contain matrix A. The next n lines must contain matrix B. Print the matrices in the format equal to format of matrix W in input. It is guaranteed that the answer exists. If there are multiple answers, you are allowed to print any of them.

The answer will be considered correct if the absolute or relative error doesn't exceed 10 - 4.

Examples

Input

2
1 4
3 2


Output

1.00000000 3.50000000
3.50000000 2.00000000
0.00000000 0.50000000
-0.50000000 0.00000000


Input

3
1 2 3
4 5 6
7 8 9


Output

1.00000000 3.00000000 5.00000000
3.00000000 5.00000000 7.00000000
5.00000000 7.00000000 9.00000000
0.00000000 -1.00000000 -2.00000000
1.00000000 0.00000000 -1.00000000
2.00000000 1.00000000 0.00000000

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
bool sortbyval(const pair<long long, long long> &a,
               const pair<long long, long long> &b) {
  return (a.second < b.second);
}
bool sortbyth(const tuple<long long, long long, long long> &a,
              const tuple<long long, long long, long long> &b) {
  return get<1>(a) < get<1>(b);
}
bool p[1000000];
void sieve() {
  memset(p, true, sizeof(p));
  p[0] = false;
  p[1] = false;
  for (long long i = 2; i * i <= 1000000; i++) {
    if (p[i] == true) {
      for (long long j = i * i; j <= 1000000; j += i) {
        if (p[j] == true) p[j] = false;
      }
    }
  }
}
long long powr(long long n, long long m) {
  if (m == 0) return 1;
  long long temp = powr(n, m / 2) % 1000000007;
  if (m & 1) {
    return ((temp * temp) % 1000000007 * n % 1000000007) % 1000000007;
  } else {
    return (temp * temp) % 1000000007;
  }
}
long long pown(long long a, long long b) {
  long long r = 1;
  while (b) {
    if (b % 2 == 1) {
      r = (r * a) % 1000000007;
    }
    b /= 2;
    a = (a * a) % 1000000007;
  }
  return r;
}
long long fact(long long n) {
  if (n == 0 or n == 1) return 1;
  return n * fact(n - 1);
}
long long power(long long x, long long n, long long M) {
  if (n == 0)
    return 1;
  else if (n % 2 == 0)
    return power((x * x) % M, n / 2, M);
  else
    return (x * power((x * x) % M, (n - 1) / 2, M)) % M;
}
long long d, x, y;
void exteuclid(long long a, long long m) {
  if (m == 0) {
    d = a;
    x = 1;
    y = 0;
  } else {
    exteuclid(m, a % m);
    long long temp = x;
    x = y;
    y = temp - (a / m) * y;
  }
}
long long modinverse(long long a, long long m) {
  exteuclid(a, m);
  return (x % m + m) % m;
}
long long modinv2(long long a, long long m) { return power(a, m - 2, m); }
void solve() {
  long long n;
  cin >> n;
  vector<vector<long long>> v(n, vector<long long>(n));
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < n; j++) {
      cin >> v[i][j];
    }
  }
  double res1[n][n];
  double res2[n][n];
  for (long long i = 0; i < n; i++) {
    res1[i][i] = v[i][i];
    res2[i][i] = 0;
  }
  for (long long i = 0; i < n; i++) {
    for (long long j = i; j < n; j++) {
      if (i != j) {
        res1[j][i] = (v[i][j] + v[j][i]) / 2.0;
        res1[i][j] = res1[j][i];
        res2[i][j] = (v[i][j] - v[j][i]) / 2.0;
        res2[j][i] = -res2[i][j];
      }
    }
  }
  cout << fixed << setprecision(8);
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < n; j++) {
      cout << res1[i][j] << " ";
    }
    cout << "\n";
  }
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < n; j++) {
      cout << res2[i][j] << " ";
    }
    cout << "\n";
  }
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long t = 1;
  while (t--) {
    solve();
  }
}