Олимпиадный тренинг

Задача 7127. Championship table - 2


A table of some championship is given. The elements of the main diagonal are 8.  Each element of the array that is not on the main diagonal can take the following values: 3 - if this team won the game, 0 - if it lost, 1 - if the game ended in a draw.

Input: The program receives as input the number N <= 15, which is the number of rows and columns in the array. Next, the input stream contains N lines of N numbers that are elements of the array.

Output: The program should print N lines of 3 numbers each: the number of wins, the number of draws and the number of losses for each team. The first line matches the first   command, etc.

# Input Output
1
3
8 0 3 
3 8 1 
0 1 8  
1 0 1
1 1 0
0 1 1