n = gets.to_i
a = Array.new(n).map{Array.new(n,0)}
for i in 0..n-1
  ans = ""
  input = gets.split(' ').map(&:to_i)
  if input.size > 2
    for j in 2..input.size-1
      a[i][input[j]-1] = 1
    end
  end
  for k in 0..a.size-1
    ans += "#{a[i][k]}"
    ans += " " if k != a.size - 1
  end
  puts ans
end