Given an n×n matrix, our task is to find the sum of all the elements in each row, as well as the sum of all the elements in each column of that matrix.
The first line of the input contains a single integer n. The next n lines contain n integers which represent the matrix.
The output should contain 2 rows:
The first row should contain the sum of elements in each row, separated by space.
The second row should contain the sum of elements in each column, separated by space.