import std.stdio, std.string, std.array, std.conv;

void main() {
    int n = readln.chomp.to!int;
    int[][] a = new int[][](n, n);
    foreach (i; 0 .. n) {
        int[] tmp = readln.chomp.split.to!(int[]);
        foreach (j; 0 .. tmp[1]) {
            a[tmp[0]-1][tmp[j+2]-1] = 1;
        }
    }
    foreach (i; 0 .. n) {
        foreach (j, x; a[i]) {
            x.write;
            if (j != n - 1) " ".write;
            else writeln;
        }
    }
}
