import Control.Applicative
import Control.Monad
import qualified Data.Vector.Unboxed as VU
import qualified Data.ByteString.Char8 as B8
import Data.List

main :: IO ()
main = do
    n <- readLn :: IO Int
    adjL <-  map (map (read :: String -> Int) . drop 2 . words) . lines <$> getContents
    let vecs = replicate n (VU.replicate n 0)
    let adjM = zipWith uparr adjL vecs
    mapM_ putStrLn $ map (intersperse ' ' . concatMap show . VU.toList) adjM


uparr :: [Int] -> VU.Vector Int -> VU.Vector Int
uparr adj vec =
    vec VU.// (uplist adj)
  where
    uplist :: [Int] -> [(Int, Int)]
    uplist = foldr (\n -> ((n - 1, 1) :) ) []
