Professor Zhang has an array of $n$ integers. He writes down some properties about the array in the paper. Each property is described by three integers $l_i$, $r_i$ and $s_i$, which means that the sum of elements modulo 2 on interval $[l_i, r_i]$ of the array is equal to $s_i$.
After that, he tries to recover the array only using the above properties. Apparently, there are many such arrays. So, Professor Zhang decides to limits the lower bound and upper bound of each integer in the array.
Given the properties, the lower bounds and the upper bounds, find the number of possible arrays and the lexicographically smallest array.