{"trustable":true,"sections":[{"title":"","value":{"format":"MD","content":"All of you must have played the game \u0027Diablo\u0027. It\u0027s an exclusive game to play. In this game the main opponent of you is Diablo. If you kill him the game finishes. But as usual, Diablo is smarter than you.\n\nDiablo has a large number of army. Diablo arranges them in a line in any arbitrary order and everyone is given an integer id. Each time Diablo either adds one army in the end or he calls for the **k\u003csup\u003eth\u003c/sup\u003e** army (from left) from the line. Then the army gets out and it attacks you.\n\nSince you are a great magician, you can read Diablo\u0027s mind. Now you want to find the id of the armies who are about to attack you."}},{"title":"Input","value":{"format":"MD","content":"Input starts with an integer **T (\u0026le; 5)**, denoting the number of test cases.\n\nThe first line of each case is a blank line. The next line contains two integers **n (0 \u0026le; n \u0026le; 10\u003csup\u003e5\u003c/sup\u003e)**, denoting the number of the initial army and **q (1 \u0026le; q \u0026le; 50000)** representing the number of queries. The next line contains **n** space separated integers. The **i\u003csup\u003eth\u003c/sup\u003e** integer of this line denotes the id of the **i\u003csup\u003eth\u003c/sup\u003e** person. Each of these integers will be positive and fits into a 32 bit signed integer. Each of the next **q** lines will contain a query, of the form:\n\n* **a p** (add a person at the end of the line whose id is **p**).\n* **c k** (call the **k\u003csup\u003eth\u003c/sup\u003e** person from the line (from left), **k** is a positive 32 bit signed integer)."}},{"title":"Output","value":{"format":"MD","content":"For each case of input, print the case number in a line. Then for all the queries **\u0027c k\u0027** you have to print the **id** of the **k\u003csup\u003eth\u003c/sup\u003e** person or **\u0027none\u0027** if there is none."}},{"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\u003e2\n\n5 5\n6 5 3 2 1\nc 1\nc 1\na 20\nc 4\nc 4\n\n2 1\n18811 1991\nc 1\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eCase 1:\n6\n5\n20\nnone\nCase 2:\n18811\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Note","value":{"format":"MD","content":"Dataset is huge, use faster I/O methods."}}]}