/*
TASK:seq
LANG:C++
*/
#include<iostream>
#include<queue>
#include<stack>
using namespace std;
stack<int> q,p;
queue<int> o;
int main()
{
    long long N,M,i,j,k,e=0;
    cin>>N;
    p.push(0);
    for (i=0;i<N;i++)
    {
        cin>>M;
               cin>>k;
               q.push(k);
               for (j=1;j<M;j++)
                   {
                   cin>>k;
                   if (k>q.top())q.push(k);
                      else if (k>p.top())p.push(k);
                              else {o.push(0);e=1;}
                   }
    if(e!=1)o.push(1);
    for (;!q.empty();)
        {q.pop();}
    for (;!p.empty();)
        {p.pop();}
    p.push(0);
    e=0;
    }
    for (i=0;i<N;i++)
        {cout<<o.front(); o.pop();}
//    for (;!q.empty();)
//        {cout<<q.top();q.pop();}
//    system("pause");
      cout<<endl;
    return 0;
}    
