# http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_11_A
n = gets.chop.to_i

a = []

n.times do
  u, k, *v = gets.chop.split.map(&:to_i)
  a << Array.new(n) { |i| (v.include?(i + 1)) ? 1 : 0 }
end

a.each { |i| i.join(' ') }