{"raw_statement":[{"iden":"problem statement","content":"You are given an integer sequence $A=(A_1,A_2,\\ldots,A_N)$ of length $N$.\nProcess $Q$ operations in order. There are three types of operations:\n\n*   A type-1 operation is represented by a triple of integers $(l,r,x)$, which corresponds to replacing $A_i$ with $\\max\\lbrace A_i,x\\rbrace$ for each $i=l,l+1,\\ldots,r$.\n*   A type-2 operation is represented by an integer $i$, which corresponds to canceling the $i$\\-th operation (it is guaranteed that the $i$\\-th operation is of type 1 and has not already been canceled). The new sequence $A$ can be obtained by performing all type-1 operations that have **not been canceled**, starting from the initial state.\n*   A type-3 operation is represented by an integer $i$, which corresponds to printing the current value of $A_i$."},{"iden":"constraints","content":"*   $1\\leq N\\leq2\\times10^5$\n*   $1\\leq A_i\\leq10^9\\ (1\\leq i\\leq N)$\n*   $1\\leq Q\\leq2\\times10^5$\n*   In a type-1 operation, $1\\leq l\\leq r\\leq N$ and $1\\leq x\\leq10^9$.\n*   In a type-2 operation, $i$ is not greater than the number of operations given before, and $1\\leq i$.\n*   In a type-2 operation, the $i$\\-th operation is of type 1.\n*   In type-2 operations, the same $i$ does not appear multiple times.\n*   In a type-3 operation, $1\\leq i\\leq N$.\n*   All input values are integers."},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$N$\n$A_1$ $A_2$ $\\ldots$ $A_N$\n$Q$\n$\\operatorname{query}_1$\n$\\operatorname{query}_2$\n$\\vdots$\n$\\operatorname{query}_Q$\n\nHere, $\\operatorname{query}_k\\ (1\\leq k\\leq Q)$ represents the $k$\\-th operation, and depending on the type of the $k$\\-th operation, one of the following is given.\nFor a type-1 operation, the following is given, meaning that the $k$\\-th operation is a type-1 operation represented by $(l,r,x)$:\n\n$1$ $l$ $r$ $x$\n\nFor a type-2 operation, the following is given, meaning that the $k$\\-th operation is a type-2 operation represented by $i$:\n\n$2$ $i$\n\nFor a type-3 operation, the following is given, meaning that the $k$\\-th operation is a type-3 operation represented by $i$:\n\n$3$ $i$"},{"iden":"sample input 1","content":"6\n2 7 1 8 2 8\n15\n3 1\n3 3\n3 4\n1 1 5 4\n3 1\n3 3\n3 4\n1 3 6 9\n3 1\n3 3\n3 4\n2 4\n3 1\n3 3\n3 4"},{"iden":"sample output 1","content":"2\n1\n8\n4\n4\n8\n4\n9\n9\n2\n9\n9\n\nInitially, the sequence $A$ is $(2,7,1,8,2,8)$.\nFor the $1$\\-st, $2$\\-nd, $3$\\-rd operations, print the values of $A_1, A_3, A_4$, which are $2,1,8$, respectively.\nThe $4$\\-th operation replaces the values of $A_1, A_2, A_3, A_4, A_5$ with $\\max\\lbrace A_i,4\\rbrace$. Just after this operation, $A$ is $(4,7,4,8,4,8)$.\nFor the $5$\\-th, $6$\\-th, $7$\\-th operations, print the values of $A_1, A_3, A_4$ at this point, which are $4,4,8$, respectively.\nThe $8$\\-th operation replaces the values of $A_3, A_4, A_5, A_6$ with $\\max\\lbrace A_i,9\\rbrace$. Just after this operation, $A$ is $(4,7,9,9,9,9)$.\nFor the $9$\\-th, $10$\\-th, $11$\\-th operations, print the values of $A_1, A_3, A_4$ at this point, which are $4,9,9$, respectively.\nThe $12$\\-th operation cancels the $4$\\-th operation. Just after this operation, $A$ is $(2,7,9,9,9,9)$.\nFor the $13$\\-th, $14$\\-th, $15$\\-th operations, print the values of $A_1, A_3, A_4$ at this point, which are $2,9,9$, respectively."},{"iden":"sample input 2","content":"24\n721 78 541 256 970 478 370 467 344 542 43 166 619 17 592 222 983 729 338 747 62 452 815 838\n35\n3 10\n3 8\n3 8\n3 13\n3 9\n1 1 17 251\n3 3\n3 19\n3 13\n3 22\n3 1\n3 15\n3 18\n3 10\n3 15\n1 16 19 883\n1 8 23 212\n3 5\n3 13\n2 6\n3 15\n1 5 18 914\n2 17\n3 20\n1 23 23 56\n3 13\n2 25\n3 13\n3 13\n3 10\n2 16\n1 17 22 308\n3 19\n3 17\n3 7"},{"iden":"sample output 2","content":"542\n467\n467\n619\n344\n541\n338\n619\n452\n721\n592\n729\n542\n592\n970\n619\n592\n747\n914\n914\n914\n914\n338\n983\n914"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}