{"trustable":true,"prependHtml":"\u003cstyle type\u003d\"text/css\"\u003e\n #problem-body \u003e pre {\n display: block;\n padding: 9.5px;\n margin: 0 0 10px;\n font-size: 13px;\n line-height: 1.42857143;\n word-break: break-all;\n word-wrap: break-word;\n color: #333;\n background: rgba(255, 255, 255, 0.5);\n border: 1px solid #ccc;\n border-radius: 6px;\n }\n\u003c/style\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv id\u003d\"problem-body\"\u003e\n\t\u003cp\u003eOne day after storm mina went to pick up mangoes in the garden with a basket. She began to pick up mangoes from the garden. And if she wants, she can throw away the last picked up mango from the basket. In this way, mina kept picking up mangoes. She brought you with her to keep track of the biggest size of mango in the basket at that time. At any moment Mina can ask you about the biggest size of mango. Your job is to help Mina.\u003c/p\u003e\r\n\u003cp\u003eSince you are a good programmer, so you write a program by which you are easily able to answer the question of Mina.\u003c/p\u003e\r\n\u003cp\u003eDuring picking up mangoes, Mina can have 3 types of question/instruction for you.\u003c/p\u003e\r\n\u003cul\u003e\r\n\u003cli\u003eType 1: put an ‘x’ size mango in the basket, which is picked up form garden.\u003c/li\u003e\r\n\u003cli\u003eType 2: Throw out last picked up mango. (There can be consecutive throw out operation.)\u003c/li\u003e\r\n\u003cli\u003eType 3: Ask for the biggest mango size in the basket at that moment.\u003c/li\u003e\r\n\u003c/ul\u003e\r\n\u003ch3\u003eInput\u003c/h3\u003e\r\n\u003cp\u003eThe first line contains a positive integer \u003cstrong\u003eT\u003c/strong\u003e, number of test case. In the following each case start with a positive integer N, which is number of question/operation Mina will ask during picking up mangoes. Next N lines will contain 3 types of operations (A, R, Q). A x, here x is picked up mango size. R, throw out last picked up mango from basket. Q Find out the biggest size mango.\u003c/p\u003e\r\n\u003ch3\u003eOutput\u003c/h3\u003e\r\n\u003cp\u003eFor each case, first print the case number and print the answer of Mina’s question. Whenever the basket is empty, then Mina’s question’s answer will be “Empty”.\u003c/p\u003e\r\n\r\n\u003cp\u003e\u003cstrong\u003e\u003cspan style\u003d\"text-decoration: underline;\"\u003eConstraints\u003c/span\u003e\u003c/strong\u003e\u003c/p\u003e\r\n\u003cul\u003e\r\n\u003cli\u003e1\u0026lt;\u003dT\u0026lt;\u003d25\u003c/li\u003e\r\n\u003cli\u003e1\u0026lt;\u003dN\u0026lt;\u003d100000\u003c/li\u003e\r\n\u003cli\u003e1\u0026lt;\u003dx\u0026lt;\u003d100000\u003c/li\u003e\r\n\u003c/ul\u003e\r\n\u003ch3\u003eExample\u003c/h3\u003e\r\n\u003cdiv\u003e\u003ctable class\u003d\"vjudge_sample\"\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\r\n6\r\nA 10\r\nA 5\r\nQ\r\nA 100\r\nR\r\nQ\r\n6\r\nA 5\r\nQ\r\nR\r\nQ\r\nR\r\nR\r\n\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eCase 1:\r\n10\r\n10\r\nCase 2:\r\n5\r\nEmpty\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/div\u003e\n\u003c/div\u003e"}}]}