adj = []
n = gets.to_i
n.times do
  u, k, *v = gets.split.map { |i| i.to_i }
  adj[u-1] = []
  (1..n).each do |j|
    adj[u-1] << ( v.include?(j) ? 1 : 0 )
  end
end

adj.each do |line|
  puts line * ' '
end