{"trustable":true,"prependHtml":"\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"panel_content\"\u003eACboy was kidnapped!! \u003cbr\u003ehe miss his mother very much and is very scare now.You can\u0027t image how dark the room he was put into is, so poor :(.\u003cbr\u003e As a smart ACMer, you want to get ACboy out of the monster\u0027s labyrinth.But when you arrive at the gate of the maze, the monste say :\" I have heard that you are very clever, but if can\u0027t solve my problems, you will die with ACboy.\"\u003cbr\u003e The problems of the monster is shown on the wall:\u003cbr\u003e Each problem\u0027s first line is a integer N(the number of commands), and a word \"FIFO\" or \"FILO\".(you are very happy because you know \"FIFO\" stands for \"First In First Out\", and \"FILO\" means \"First In Last Out\").\u003cbr\u003e and the following N lines, each line is \"IN M\" or \"OUT\", (M represent a integer).\u003cbr\u003e and the answer of a problem is a passowrd of a door, so if you want to rescue ACboy, answer the problem carefully!\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"The input contains multiple test cases.\u003cbr\u003eThe first line has one integer,represent the number oftest cases.\u003cbr\u003eAnd the input of each subproblem are described above."}},{"title":"Output","value":{"format":"HTML","content":"For each command \"OUT\", you should output a integer depend on the word is \"FIFO\" or \"FILO\", or a word \"None\" if you don\u0027t have any integer."}},{"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\u003e4\r\n4 FIFO\r\nIN 1\r\nIN 2\r\nOUT\r\nOUT\r\n4 FILO\r\nIN 1\r\nIN 2\r\nOUT\r\nOUT\r\n5 FIFO\r\nIN 1\r\nIN 2\r\nOUT\r\nOUT\r\nOUT\r\n5 FILO\r\nIN 1\r\nIN 2\r\nOUT\r\nIN 3\r\nOUT\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1\r\n2\r\n2\r\n1\r\n1\r\n2\r\nNone\r\n2\r\n3\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}