import scala.io.StdIn.{readInt, readLine};

object Main {
    def main(args: Array[String]): Unit = {
        val n = readInt;
        val matrix = Array.ofDim[Int](n, n);
        (0 until n).foreach { i =>
            readLine.split(" ").drop(2).map(_.toInt).foreach { j => matrix(i)(j - 1) = 1;}
        }
        matrix.foreach { e => println(e.mkString(" "))}
    }
}
