def main
  n = gets.to_i
  arr = Array.new(n){Array.new(n, 0)}
  n.times do
    arg = gets.split(" ").map(&:to_i)
    arg[1].times do |i|
      arg[2 + i..-1].each do |item|
        arr[arg[0] - 1][item - 1] = 1
      end
    end
  end
  arr.each{|item|puts item.join(" ")}
end
main