import Control.Monad
import Control.Applicative

main = do
    n <- readLn
    replicateM_ n $ do
        lines <- (map read . drop 2 . words) <$> getLine
        putStrLn $ unwords $ map (\a -> if elem a lines then "1" else "0") [1..n]