Sources and sinks
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
The vertex of directed graph is called a source if no edge comes into it, and a sink if no edge comes out of it.
The directed graph is given with adjacency matrix. Find all its sources and sinks.
Input
The first line contains the number of vertices in a graph n (1 ≤ n ≤ 100), then the adjacent matrix is given - n lines with n numbers, each of them equals to 0 or 1.
Output
Print in the first line the number of sources in a graph, and then sources in increasing order. Print in the second line the information about sinks in the same format.
Examples
Input #1
Answer #1
Submissions 4K
Acceptance rate 65%