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;
bool isPrime(long long int n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (long long int i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
unsigned int countBits(unsigned int n) {
  unsigned int count = 0;
  while (n) {
    count++;
    n >>= 1;
  }
  return count;
}
bool isPerfectSquare(long double x) {
  long double sr = sqrt(x);
  return ((sr - floor(sr)) == 0);
}
int subArraySum(int arr[], int n) {
  int curr_sum = arr[0], start = 0, i, count = 0, len;
  len = 0;
  for (i = 1; i <= n; i++) {
    len++;
    while (curr_sum > len && start < i - 1) {
      curr_sum = curr_sum - arr[start];
      start++;
      len++;
    }
    if (curr_sum == len) {
      count++;
    }
    if (i < n && i > 0) {
      curr_sum = curr_sum + arr[i];
    }
  }
  return count;
}
void printDigit(int N, vector<long long int>& arr) {
  int i = 0;
  int j, r;
  while (N != 0) {
    r = N % 10;
    arr.push_back(r);
    i++;
    N = N / 10;
  }
}
void solver(vector<long long int> arr, long long int start,
            long long int& count, long long int a1) {
  long long int sum = 0;
  for (long long int i = start + 1; i < arr.size() - 1; i++) {
    sum += arr[i];
    if (sum == a1) count++;
  }
}
bool checkDivisibility(long long int n, int digit) {
  if (digit == 0) return true;
  return (digit != 0 && n % digit == 0);
}
bool allDigitsDivide(long long int n) {
  long long int temp = n;
  while (temp > 0) {
    int digit = temp % 10;
    if (!(checkDivisibility(n, digit))) return false;
    temp /= 10;
  }
  return true;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long int b = 0, q, c, x, y, start = 0, end = 0, count = 0, neg = 0,
                pos = 0, count1 = 0, a1 = 0, b1 = 0, c1 = 0, x1, y1, d, n1, n,
                m, r, ans = 0;
  bool check2 = false, check3 = false;
  double sum = 0;
  int curr1 = 0, curr = 0;
  cin >> n;
  double k = 0;
  double arr[n][n];
  string str;
  long long int vb;
  bool check1 = false, check4 = false;
  vector<double> arrv;
  unordered_map<long int, long int> map;
  vector<bool> check(x + 5, 0);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cin >> arr[i][j];
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      float dig = (arr[i][j] + arr[j][i]) / 2;
      printf("%.5f ", dig);
    }
    printf("\n");
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      printf("%.5f ", (arr[i][j] - (arr[i][j] + arr[j][i]) / 2));
    }
    printf("\n");
  }
  return 0;
}