# 目次
# 解答
int main(void) {
int n, v, c, l;
cin >> n;
int mat[n][n];
loop(i,0,n) {
loop(j,0,n) {
mat[i][j] = 0;
}
}
loop(i, 0, n) {
cin >> v >> c;
loop(j,0,c) {
cin >> l;
mat[v-1][l-1] = 1;
}
}
loop(i,0,n) {
loop(j,0,n) {
if (j) cout << " ";
cout << mat[i][j];
}
cout << endl;
}
}