n=gets.to_i;
a=Array.new(n){Array.new(n,0)}
m=Array.new
n.times do |i|
  m.clear
  m=gets.split.map{|i|i.to_i}
  m[1].times do |j|
    a[m[0]-1][m[j+2]-1]=1
  end
end
n.times do |i|
  print a[i],"\n"
end
