n = gets.chomp.to_i

array = Array.new(n).map{Array.new(n,0)}
# p array
n.times do |i|
  retu = gets.chomp.split(" ").map(&:to_i)
  retu[1].times do |j|
    array[i][retu[j+2]-1] = 1
  end
end

array.each do |arr|
  output = ""
  arr.each_with_index do |char, i|
    if i == arr.length-1
      output = output + char.to_s + "\n"
    else
      output = output + char.to_s + " "
    end
  end
  print output
end

