#include <iostream>
#include <stdio.h>

using namespace std;

int main() {
	int n, u, k, tmp;
	int v[100];
	int ans[100][100] = {};
	cin >> n;
	for (int i = 0; i < n; i++)
	{
		cin >> u >> k;
		for (int j = 0; j < k; j++)
		{
			cin >> tmp;
			ans[u - 1][tmp - 1] = 1;
		}
	}
	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < n-1; j++)
		{
			cout << ans[i][j] << " "; 
		}
		cout << ans[i][n - 1] << endl;
	}
	return 0;
}
