const line = require('fs').readFileSync('/dev/stdin', 'utf-8').split('\n');

const data = line.slice(1, Number(line[0])+1)
                 .map(x => x.split(' ').map(Number))
                 .map(xs => {
                     return {id: xs[0]-1, point: xs.slice(2).map(x => x-1)};
                 })
                 .reduce((acc, x, _, arr) => {
                    acc[x.id] = x.point.reduce((a, y) => {
                        a[y] = 1;
                        return a;
                    }, [...Array(Number(line[0]))].fill(0));
                    return acc;
                 }, [...Array(Number(line[0]))].fill([]))
                 .map(x => x.join(' '))
                 .join('\n');

console.log(data);

