{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003e\u003cp\u003eYour friend, Jackson is invited to a TV show called SuperMemo in which the participant is told to play a memorizing game. At first, the host tells the participant a sequence of numbers, {\u003cem\u003eA\u003c/em\u003e\u003csub\u003e1\u003c/sub\u003e, \u003cem\u003eA\u003c/em\u003e\u003csub\u003e2\u003c/sub\u003e, ...\u003cem\u003eA\u003csub\u003en\u003c/sub\u003e\u003c/em\u003e}. Then the host performs a series of operations and queries on the sequence which consists:\u003c/p\u003e\u003col\u003e\u003cli\u003e\u003cp\u003e\u003cem\u003eADD x y D\u003c/em\u003e: Add D to each number in sub-sequence {\u003cem\u003eA\u003csub\u003ex\u003c/sub\u003e\u003c/em\u003e ... \u003cem\u003eA\u003csub\u003ey\u003c/sub\u003e\u003c/em\u003e}. For example, performing \"\u003cem\u003eADD\u003c/em\u003e 2 4 1\" on {1, 2, 3, 4, 5} results in {1, 3, 4, 5, 5}\u003c/p\u003e\u003c/li\u003e\u003cli\u003e\u003cp\u003e\u003cem\u003eREVERSE x y\u003c/em\u003e: reverse the sub-sequence {\u003cem\u003eA\u003csub\u003ex\u003c/sub\u003e\u003c/em\u003e ... \u003cem\u003eA\u003csub\u003ey\u003c/sub\u003e\u003c/em\u003e}. For example, performing \"\u003cem\u003eREVERSE\u003c/em\u003e 2 4\" on {1, 2, 3, 4, 5} results in {1, 4, 3, 2, 5}\u003c/p\u003e\u003c/li\u003e\u003cli\u003e\u003cp\u003e\u003cem\u003eREVOLVE x y T\u003c/em\u003e: rotate sub-sequence {\u003cem\u003eA\u003csub\u003ex\u003c/sub\u003e\u003c/em\u003e ... \u003cem\u003eA\u003csub\u003ey\u003c/sub\u003e\u003c/em\u003e} \u003cem\u003eT\u003c/em\u003e times. For example, performing \"\u003cem\u003eREVOLVE\u003c/em\u003e 2 4 2\" on {1, 2, 3, 4, 5} results in {1, 3, 4, 2, 5}\u003c/p\u003e\u003c/li\u003e\u003cli\u003e\u003cp\u003e\u003cem\u003eINSERT x P\u003c/em\u003e: insert \u003cem\u003eP\u003c/em\u003e after \u003cem\u003eA\u003csub\u003ex\u003c/sub\u003e\u003c/em\u003e. For example, performing \"\u003cem\u003eINSERT\u003c/em\u003e 2 4\" on {1, 2, 3, 4, 5} results in {1, 2, 4, 3, 4, 5}\u003c/p\u003e\u003c/li\u003e\u003cli\u003e\u003cp\u003e\u003cem\u003eDELETE x\u003c/em\u003e: delete \u003cem\u003eA\u003csub\u003ex\u003c/sub\u003e\u003c/em\u003e. For example, performing \"\u003cem\u003eDELETE\u003c/em\u003e 2\" on {1, 2, 3, 4, 5} results in {1, 3, 4, 5}\u003c/p\u003e\u003c/li\u003e\u003cli\u003e\u003cp\u003e\u003cem\u003eMIN x y\u003c/em\u003e: query the participant what is the minimum number in sub-sequence {\u003cem\u003eA\u003csub\u003ex\u003c/sub\u003e\u003c/em\u003e ... \u003cem\u003eA\u003csub\u003ey\u003c/sub\u003e\u003c/em\u003e}. For example, the correct answer to \"\u003cem\u003eMIN\u003c/em\u003e 2 4\" on {1, 2, 3, 4, 5} is 2\u003c/p\u003e\u003c/li\u003e\u003c/ol\u003e\u003cp\u003eTo make the show more interesting, the participant is granted a chance to turn to someone else that means when Jackson feels difficult in answering a query he may call you for help. You task is to watch the TV show and write a program giving the correct answer to each query in order to assist Jackson whenever he calls.\u003c/p\u003e\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"The first line contains n (n ≤ 100000).\u003cbr\u003eThe following n lines describe the sequence.\u003cbr\u003eThen follows M (M ≤ 100000), the numbers of operations and queries.\u003cbr\u003eThe following M lines describe the operations and queries."}},{"title":"Output","value":{"format":"HTML","content":"For each \"MIN\" query, output the correct answer."}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e5\r\n1 \r\n2 \r\n3 \r\n4 \r\n5\r\n2\r\nADD 2 4 1\r\nMIN 4 5\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e5\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}