#include<iostream>
#include<algorithm>
using namespace std;
bool point[100][100];

int main()
{
	int num,n1,n2,n3;
	cin >> num;
	for (int i = 0; i < num; i++) {
		cin >> n1 >> n2;
		for (int k = 0; k < n2; k++) {
			cin >> n3;
			point[n1 - 1][n3 - 1] = 1;
		}
	}
	for (int i = 0; i < num; i++) {
		for (int k = 0; k < num; k++) {
			if (k) { cout <<" "; }
			cout << point[i][k];
		}
		cout << endl;
	}
	
}
