(function (stdin) {
  var lines = stdin.trim().split('\n');
  var n = parseInt(lines.shift(), 10);
  lines.forEach(function(node) {
    var me = [];
    for (var i = 0; i < n; i++) {
      me.push(0);
    }
    var adj = node.split(' ').map(Number).slice(2);
    adj.forEach(function (a) {
      me[a - 1] = 1;
    });
    console.log(me.join(' '));
  });
})(require('fs').readFileSync('/dev/stdin', 'utf8'));