(function main() {
  const lines = require('fs').readFileSync('/dev/stdin', 'utf8').split('\n');
  const n = Number(lines.shift());
  const res = [];
  for (let i = 0; i < n; i++) {
    res[i] = [];
    for (let j = 0; j < n; j++) {
      res[i][j] = 0;
    }
  }

  lines.forEach((l, i) => l.split(' ').splice(2).forEach(e => res[i][e-1] = 1));
  console.log(res.map(r => r.join(' ')).join('\n'));
})();
