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 JAVA):

Solution:
import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.InputMismatchException;
import java.io.BufferedWriter;
import java.io.PrintWriter;
import java.io.Writer;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.IOException;
/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author Alex
 */
public class Main{
	public static void main(String[] args){
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		OutputWriter out = new OutputWriter(outputStream);
		TaskB solver = new TaskB();
		solver.solve(1, in, out);
		out.close();
	}
	static class TaskB{
		public void solve(int testNumber, InputReader in, OutputWriter out){
			int n = in.ri();
			int[][] w = IOUtils.readIntTable(in, n, n);
			double[][] a = new double[n][n], b = new double[n][n];
			for(int i = 0; i < n; i++) {
				for(int j = 0; j < n; j++) {
					a[i][j] = (double) (w[i][j] + w[j][i]) / 2;
					b[i][j] = (double) (w[i][j] - w[j][i]) / 2;
				}
			}
			for(double[] t : a) out.printLine(t);
			for(double[] t : b) out.printLine(t);
		}
	}
	static class IOUtils{
		public static int[] readIntArray(InputReader in, int size){
			int[] array = new int[size];
			for(int i = 0; i < size; i++)
				array[i] = in.readInt();
			return array;
		}
		public static int[][] readIntTable(InputReader in, int rowCount, int columnCount){
			int[][] table = new int[rowCount][];
			for(int i = 0; i < rowCount; i++)
				table[i] = readIntArray(in, columnCount);
			return table;
		}
	}
	static class InputReader{
		private InputStream stream;
		private byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;
		private SpaceCharFilter filter;
		public InputReader(InputStream stream){
			this.stream = stream;
		}
		public int read(){
			if(numChars == -1)
				throw new InputMismatchException();
			if(curChar >= numChars){
				curChar = 0;
				try{
					numChars = stream.read(buf);
				} catch(IOException e){
					throw new InputMismatchException();
				}
				if(numChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}
		public int ri(){
			return readInt();
		}
		public int readInt(){
			int c = read();
			while(isSpaceChar(c))
				c = read();
			int sgn = 1;
			if(c == '-'){
				sgn = -1;
				c = read();
			}
			int res = 0;
			do{
				if(c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while(!isSpaceChar(c));
			return res * sgn;
		}
		public boolean isSpaceChar(int c){
			if(filter != null)
				return filter.isSpaceChar(c);
			return isWhitespace(c);
		}
		public static boolean isWhitespace(int c){
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}
		public interface SpaceCharFilter{
			public boolean isSpaceChar(int ch);
		}
	}
	static class OutputWriter{
		private final PrintWriter writer;
		public OutputWriter(OutputStream outputStream){
			writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
		}
		public OutputWriter(Writer writer){
			this.writer = new PrintWriter(writer);
		}
		public void printLine(double[] array){
			for(int i = 0; i < array.length; i++) {
				if(i != 0)
					writer.print(' ');
				writer.print(array[i]);
			}
			writer.println();
		}
		public void close(){
			writer.close();
		}
	}
}