{"trustable":false,"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":"MD","content":"每个问题的第一行都有一个整数 N(有N个命令),还有 \"FIFO\" 或 \"FILO\"(\"FIFO\"代表 \"First In First Out\", 并且 \"FILO\" 代表 \"First In Last Out\"). \n接下来 N 行, 每行都是\"IN M\" 或者 \"OUT\", (M 代表一个整数). \n输出你的答案"}},{"title":"Input","value":{"format":"MD","content":"包含多组输入\n\u003cbr\u003e第一行包含一个整数,代表组数\n\u003cbr\u003e接下来的输入如描述所述"}},{"title":"Output","value":{"format":"MD","content":"每得到一个 \"OUT\", 你必须根据 \"FIFO\" 或 \"FILO\"的原则,立刻输出一个整数, 或者如果还没有得到任何整数的话就输出 \"None\" "}},{"title":"Sample Input","value":{"format":"MD","content":"\u003cpre\u003e4\n4 FIFO\nIN 1\nIN 2\nOUT\nOUT\n4 FILO\nIN 1\nIN 2\nOUT\nOUT\n5 FIFO\nIN 1\nIN 2\nOUT\nOUT\nOUT\n5 FILO\nIN 1\nIN 2\nOUT\nIN 3\nOUT\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"MD","content":"\u003cpre\u003e1\n2\n2\n1\n1\n2\nNone\n2\n3\u003c/pre\u003e"}}]}