Let's first see a related classical algorithm to help you solve this problem: You will be given $n$ functions $f_1(x),f_2(x),\dots,f_n(x)$, where $f_i(x)=a_ix+b_i$. When you want to find the minimum value of $f_i(x)$ for a fixed parameter $x$, you just need to find the corresponding function on the convex hull.
Now you will be given $n$ functions $f_1(x),f_2(x),\dots,f_n(x)$, where $f_i(x)=(x-a_i)^4+b_i$.
You need to perform the following operations for $m$ times:
· "$\texttt{1 a b}$" ($1\leq a\leq 50\,000,1\leq b\leq 10^{18}$): Add a new function $f_{n+1}(x)=(x-a)^4+b$ and then change $n$ into $n+1$.
· "$\texttt{2 t}$" ($1\leq t\leq n$): Delete the function $f_{t}(x)$. It is guaranteed that each function won't be deleted more than once.
· "$\texttt{3 x}$" ($1\leq x\leq 50\,000$): Query for the minimum value of $f_i(x)$, where $1\leq i\leq n$ and the function $f_i(x)$ has not been deleted yet.