Adjacency Lists to an Adjacency Matrix


Submit solution

Points: 100
Time limit: 2.0s
Memory limit: 256M

Author:
Problem types

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

There are no comments at the moment.