{"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被绑架了!! \u003cbr\u003e他非常想念他的妈妈,现在非常害怕。你无法想象他被关在的房间有多黑,太可怜了 :(.\u003cbr\u003e 作为聪明的ACMer,你想要把ACboy从怪物的迷宫中救出来。但当你到达迷宫的大门时,怪物说:“我听说你很聪明,但如果不能解决我的问题,你将和ACboy一起死去。”\u003cbr\u003e 怪物的问题显示在墙上:\u003cbr\u003e 每个问题的第一行是一个整数N(命令的数量),和一个单词“FIFO”或“FILO”(你非常高兴因为你知道“FIFO”代表“先进先出”,而“FILO”意味着“先进后出”)。\u003cbr\u003e 接下来的N行,每行是“IN M”或“OUT”,(M代表一个整数)。\u003cbr\u003e 一个问题的答案是一扇门的密码,所以如果你想要救出ACboy,要仔细回答问题!\u003c/div\u003e"}},{"title":"输入","value":{"format":"HTML","content":"输入包含多个测试用例。\u003cbr\u003e第一行包含一个整数,表示测试用例的数量。\u003cbr\u003e每个子问题的输入如上所述。"}},{"title":"输出","value":{"format":"HTML","content":"对于每个“OUT”命令,你应该根据单词是“FIFO”还是“FILO”输出一个整数,如果你没有任何整数,则输出单词“None”。"}},{"title":"样例","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"}}]}