Condition to check if there is a possible solution
if ( flag ) cout << ( -1 ) ; else { vector < char > form ( n , ' ▁ ' ) ; for ( int i = 0 ; i < n ; i ++ ) { int indi = interval [ i ] [ 2 ] ; form [ indi ] = interval [ i ] [ 3 ] ; }