You are given a binary string $$$s$$$ of length $$$n$$$ and must process $$$q$$$ operations of the following types:
- 1 l r: For every $$$i$$$ ($$$l \le i \le r$$$), replace $$$s_i$$$ with $$$1 - s_i$$$.
- 2 l r: Delete a subsegment of $$$s_l s_{l+1} \ldots s_r$$$ (possibly empty or the entire interval). Among all possible choices, find the maximum absolute difference between the number of characters 1 and the number of characters 0 in the remaining string. The deletion applies only to this operation and does not affect subsequent queries.
Output
For each operation of type 2, print one integer — the maximum possible absolute difference between the number of characters 1 and the number of characters 0 in the remaining string.
Note
In the first example:
- The first operation is a query, and the queried interval is 11010. Deleting the character at position $$$3$$$ leaves 1110 in the queried interval, which contains $$$2$$$ more characters 1 than characters 0.
- The second operation inverts the characters at positions $$$2$$$ through $$$4$$$, so the string becomes 10100.
- The third operation is a query, and the queried interval is 10100. Deleting the character at position $$$1$$$ leaves 0100 in the queried interval, which contains $$$2$$$ more characters 0 than characters 1.
- The fourth operation is a query, and the queried interval is 010. Deleting the character at position $$$2$$$ of this interval leaves 00 in the queried interval, which contains $$$2$$$ more characters 0 than characters 1.
- The fifth operation is a query, and the queried interval is 1. Deleting the empty string leaves 1 in the queried interval, which contains $$$1$$$ more character 1 than characters 0.