adj = Hash.new
n = gets.to_i
n.times do
  l = gets.split.map(&:to_i)
  adj[l.shift] = l[1..-1]
end
adj.sort.transpose[1].each do |v|
  arr = Array.new(n,0)
  v.each{|i| arr[i-1]=1} if v
  puts arr.join(" ")
end