from sys import stdin

n = int(stdin.readline())

v = [[0] * (n + 1) for i in range(n + 1)]

for u in range(1, n + 1):

    U = [int(j) for j in stdin.readline().split()]

    for k in U[2:]:

        v[u][k] += 1

for i in range(1, n + 1):

    print((*v[i][1:]))
from sys import stdin

n = int(stdin.readline())

v = [[0] * n for _ in range(n)]

for u in range(n):

    l = list(map(int, stdin.readline().split()))

    for k in l[2:]:

        v[u][k - 1] = 1

    print((*v[u]))
from sys import stdin

n = int(stdin.readline())
v = [[0] * (n + 1) for i in range(n + 1)]
for u in range(1, n + 1):
    U = [int(j) for j in stdin.readline().split()]
    for k in U[2:]:
        v[u][k] += 1
for i in range(1, n + 1):
    print((*v[i][1:]))

from sys import stdin

n = int(stdin.readline())
v = [[0] * n for _ in range(n)]
for u in range(n):
    l = list(map(int, stdin.readline().split()))
    for k in l[2:]:
        v[u][k - 1] = 1
    print((*v[u]))

-v = [[0] * (n + 1) for i in range(n + 1)] -for u in range(1, n + 1): -    U = [int(j) for j in stdin.readline().split()] -    for k in U[2:]: -        v[u][k] += 1 -for i in range(1, n + 1): -    print((*v[i][1:])) +v = [[0] * n for _ in range(n)] +for u in range(n): +    l = list(map(int, stdin.readline().split())) +    for k in l[2:]: +        v[u][k - 1] = 1 +    print((*v[u]))