def graph()
  n = gets.to_i
  a = []
  b = []
  for k in 0..n-1
    b[k] = []
    for l in 0..n-1
      b[k][l] = 0
    end
  end
  for i in 0..n-1
    a[i] = gets.split(' ').map(&:to_i)
    if a[i][1] > 0
      for j in 2..a[i][1]+1
        c = a[i][j] - 1
        b[i][c] = 1
      end
    end
    puts b[i].join(' ')
  end
end

graph()