Sources and sinks#478

Sources and sinks

1 second
128 megabytes
Very easy (≈850)

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.

prb3986.gif

Examples

Example 1

Loading
Loading