#include <iostream>
using namespace std;
int mat[101][101];

int main(){
  int n;
  cin >> n;
  for (int i=0;i<n;i++){
    int id,k;
    cin >> id >> k;
    for (int j=0;j<k;j++){
      int temp;
      cin >> temp;
      mat[id][temp] = 1;
    }
  }
  for (int i=1;i<=n;i++){
    for(int j=1;j<=n;j++){
      if (j!=1)
        cout << " ";
      cout << mat[i][j];
    }
    cout << endl;
  }
  return 0;
}

