n = gets.to_i

m = Array.new(n){ Array.new(n, 0) }

n.times do
	line = gets.split.map &:to_i
	u, k = line.shift, line.shift
	u -= 1
	k.times do
		v = line.shift
		v -= 1
		m[u][v] = 1
	end
end

n.times do |i|
	n.times do |j|
		print " " if j != 0
		print m[i][j]
	end
	puts
end