Adjacency Lists to an Adjacency Matrix
Convert adjacency lists to an adjacency matrix.
Input
The first line contains n. The next n lines list the neighbors of vertices 1 through n; a line may be empty.
1 <= n <= 1000
Output
Print the n by n adjacency matrix.
Example
Input
3
2 3
1
1
Output
0 1 1
1 0 0
1 0 0
Comments