CSES - Dynamic Lines
  • Time limit: 2.00 s
  • Memory limit: 512 MB

In this task you are given nn lines, and have to answer a total of qq queries of three types.

    1. Activate line with index ii. It is guaranteed that the line is inactive.
    1. Deactivate line with index ii. It is guaranteed that the line is active.
    1. What is the lowest value any active line has at a given xx-coordinate? The value of line ii at point xx is fi(x)=aix+bif_{i}(x) = a_{i} x + b_{i}. It is guaranteed at least one line is active.

Initially all lines are inactive.

Input

The first line contains two integers n,qn, q: the number of lines and the number of queries.
the second line contains nn integers a1,,ana_1, \dots, a_n.
the third line contains nn intergets b1,,bnb_1, \dots, b_n.

qq lines follow, describing the queries. Each line contains two integers tt vv: The query is of type tt. If t=1t = 1 or t=2t = 2, i=vi = v. If t=3t = 3, x=vx = v.

Output

Output the answer to each query of type 33.

Constraints

  • 1n,q41051 \leq n, q \leq 4 \cdot 10^{5}
  • 109x,a,b109-10^9 \leq x, a, b \leq 10^{9}
  • 1in1 \leq i \leq n

Example

Input:

4 12
-1 -2 0 -1
-18 13 4 -14
1 1
3 9
2 1
1 2
3 7
1 4
1 3
1 1
2 1
3 -4
3 10
3 -9

Output:

-27 -1 -10 -24 -5