N = gets.to_i
m = Array.new(N)
for i in 0..N-1
  m[i] = Array.new(N,0)
end
for i in 0..N-1
  temp = gets.chomp.map(&:to_i)
  if temp[1] != 0
    for j in 0..temp[1]-1
      m[i][temp[j+2]] = 1
    end
  end
end
m.each do |r|
  puts r.join(" ")
end