#include<iostream>
using namespace std;
int main()
{
	const int MAX = 101;
	int G[MAX][MAX] = {0};
	int n;
	cin >> n;
	for (int i = 1; i <= n; i++)
	{
		int u, d;
		cin >> u >> d;
		for (int j = 1; j <= d; j++)
		{
			int v;
			cin >> v;
			G[u][v] = 1;
		}
	}
	for (int i = 1; i <= n; i++)
		for (int j = 1; j <= n; j++)
			if (j != n)
				cout << G[i][j] << " ";
			else
				cout << G[i][j] << endl;
}
