You are provided with a string - S of 0 and 1 of size n.
You have to perform 2 types of operations -
Type 1 - Flip x - Flip the character at xth position of string S i.e convert it to 0 if it is 1 and vice versa.
Type 2 - Query x y - Output the lowest index idx in range [ x , y ] inclusive such that S[idx] = '0'. Output -1 if no such character exists.
Input
First line of the input consist of n - the size of the string.
Next line consist of the string of 0s and 1s.
Next line consist of single integer Q - the number of queries.
Q lines follows - each is a query of Type 1 or Type 2.
1 x - Flip xth character
2 x y - Output the lowest index idx in range [ x , y ] inclusive such that S[idx] = '0'.
Output
For each Query of type 2 - Output the answer in a seperate line.
Constraint
1<=n, Q<=5*10^5
NOTE - 1-based indexing is used.