N Q p_0 a_0 p_1 a_1 : : p_{N - 1} a_{N - 1} query_0 query_1 : : query_{Q - 1}THe format of query_i is one of the three format:
1 v_i d_i x_i
2 v_i d_i
3 pr_i ar_i
6 7 -1 6 0 5 0 4 2 3 2 2 1 1 2 0 1 1 0 2 1 2 2 1 3 3 3 2 0 3 3 3 4 2 1 1
15 12 30 8
7 9 -1 1 0 5 0 7 0 8 1 3 4 1 5 1 2 1 1 2 1 2 1 1 2 3 1 4 1 1 2 3 1 2 0 2 3 6 1 3 7 11 2 0 15
8 9 8 31 49