You are given a Binary String A of length N indexed from 0 to \(N-1\). You have to perform 2 queries:-
- 0 L R - Tell the remainder of Number(in \(Decimal\)) represented by the Binary String between indexes L and R when divided by 5.
- 1 X V - Replace character at position X with V.
INPUT FORMAT
First line contains T which denotes the number of test cases.
The first line of each test case contains the binary string A.
The next line contains Q which is the number of queries.
Next Q lines contain the description of queries which may be of either of the 2 types as described in the problem statement.
OUTPUT FORMAT
For each query of Type 0, print the answer in a single line.
CONSTRAINTS
- \(1 ≤ T ≤ 100\)
- \(1 ≤ N,Q ≤ 10^{4}\)
- \(0 ≤ L ≤ R < N\)
- \(0 ≤ X < N\)
- \(0 ≤ V ≤ 1\)
Hints for using the inbuilt code snippet
Let us take the example of sample input. So your function should return the output such that it resembles "0" + "\n" + "3" + "\n" + "2" + "\n" so that it correctly matches the output format as asked. You can use other alternatives too but the output format as rendered by the print function should match the format of sample out.
Note: It is not mandatory to use the code snippet that is provided to you in the editor by default. It is just to make the question more convenient. You can completely remove the default code and submit your solution in the appropriate format.