import scala.io.StdIn

object Main extends App {

  val n = StdIn.readLine().toInt
  val result = Array.fill[Int](n+1, n+1)(0)
  (0 until n).foreach { _ =>
    val a = StdIn.readLine().split(' ').map(_.toInt)
    (0 until a(1)).foreach { k =>
      result(a(0))(a(2+k)) = 1
    }
  }

  (1 to n).foreach { i =>
    println(result(i).drop(1).mkString(" "))
  }


}
