n = STDIN.gets.to_i
matrix = Array.new(n) { Array.new(n, 0) }

n.times do
	node_no, degree, *adj_list = STDIN.gets.split.map(&:to_i)
	degree.times do |i|
		matrix[node_no - 1][adj_list[i] - 1] = 1
	end
end

matrix.each do |adj|
	puts "#{adj.join(" ")}"
end