New meta.
A zigzag cycle in an undirected graph is a sequence of vertices a_0,a_1,…,a_k−1, \uline{not necessarily distinct}, such that for all i:0≤i<k a_i and a_(i+1)modk are adjacent in the graph and one of the following holds:
A cycle contains the edge (u,v) p times if there exist exactly p distinct i:0≤i<k, such that a_i=u,a_(i+1)modk=v or a_i=v,a_(i+1)modk=u.
A graph is splittable if there exists a set of zigzag cycles, such that for each edge exactly one cycle contains it 1 time and all the remaining cycles contain it 0 times, i.e. you can split edges of the graph into zigzag cycles.
There is a graph which is initially empty. Process the following types of queries:
After each query print whether the graph is splittable.
The first line contains two integers n and q (2≤n≤3⋅105,1≤q≤3⋅105) --- the number of vertices in the graph and the number of queries, respectively.
q lines follow. i-th of them contains three integers t,u,v (t∈1,2,1≤u<v≤n) --- the type of query and the endpoints of the edge you have to add if t=1 or remove if t=2. No query will ask to you to add an already present edge or to delete an absent one.
Print q lines. i-th of them should contain 1 if the graph is splittable after the first i queries and 0 otherwise.
After processing all the queries one possible set of zigzag cycles is \[1,4,3,5],\[2,6,4,5].