Sakura has invented a new kind of calculator that can evaluate expressions. This calculator maintains a serial of operators and numbers inside. All these numbers and operators form an ordered table. For example
$*4 \quad + 2 \quad \hat{} 3 \quad + 8 \quad * 6$
is a possible table. The calculator also supports the following two operations.
1. 1 $x$.
This corresponds to the evaluation operation. For instance, if $x=2$, together with the table being the one described above, the calculator will output
$ ((((2*4)+2)^3)+8)*6=6048.$
As for $x=3$, it will output
$((((3*4)+2)^3)+8)*6=16512.$
2. 2 $p$ $cx$.
This corresponds to the modification operation. The calculator will change the $p$-th term in the expression to $cx$. Here $c$ denotes an operator while $x$ denotes a number.
For example, if $p=3$ and $cx=*5$, the expression will become
$*4 \quad + 2 \quad *5 \quad + 8 \quad * 6.$
Now you are asked to implement this calculator. However, for technical reasons, you should just output the result modulo 29393. It is guaranteed that, in all terms appeared in the input data, $c \in \{+, *, \hat{} \}$, $0 \le x < 29393$.