LearnPy Hub
← File Handling problems
Hard

Column Totals

Read r, then r lines of space-separated integers, and write them to grid.txt. Read the file back and print the total of each column on one line.

Input

r, then r lines of equal length.

Output

One line.

Sample 1

Input
2
1 2 3
4 5 6
Output
5 7 9

Sample 2

Input
1
7 8
Output
7 8
solution.py
Output appears here
Column Totals · Python practice problem · LearnPy Hub