Elly has two sequences a_1,a_2,…,a_n and b_1,b_2,…,b_n. She would like to perform the following operations:
1 x y, change the value of a_x to y.2 x y, change the value of b_x to y.3 x, find the value of c_x, where c_0=0, c_i=max(c_i−1+b_i,a_i) for 1≤i≤x.Implement an efficient data structure to process those operations.
The input consists of several test cases terminated by end-of-file. For each test case:
The first line contains two integers n and m , which are the length of the two sequences and the number of operations. The second line contains n integers a_1,a_2,…,a_n. The third line contains n integers b_1,b_2,…,b_n. Each of the last m lines contains a query.
For each query of type 3, output an integer denoting the value of c_x.