#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (n); i++)
using namespace std;
using ll = long long;

int main(){
	int n; cin >> n;
	int ga[n][n];
	memset(ga, 0, n*n*sizeof(int));
	rep(i, n){
		int u, k; cin >> u >> k;
		rep(j, k){
			int v; cin >> v;
			ga[u-1][v-1] = 1;
		}
	}

	rep(i, n)rep(j, n) cout << ga[i][j] << char((j == n-1)?'\n':' ');
	return 0;
}

