{"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":"HTML","content":"\u003cscript type\u003d\u0027text/x-mathjax-config\u0027\u003eMathJax.Hub.Config({tex2jax: { inlineMath: [[\u0027$\u0027,\u0027$\u0027]] } }); \u003c/script\u003e\n\u003cscript type\u003d\u0027text/javascript\u0027 src\u003d\u0027https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\u0027\u003e\u003c/script\u003e\n\u003cscript type\u003d\u0027text/javascript\u0027\u003esetTimeout(function(){MathJax.Hub.Queue([\u0027Typeset\u0027, MathJax.Hub, \u0027left_view\u0027]);}, 2000);\u003c/script\u003e\n\u003cdiv class\u003d\"panel_content\"\u003e\n 快过年了,徐书记的火车站现在非常繁忙。很多学生想坐火车回学校(因为只有火车)。但有个问题一直困扰着徐书记,他的车站只有一条铁路,所有的火车都停在那里。所以所有的火车都是从一边进站,从另一边出站。对于这个问题,如果A列先进入铁路,然后B列在A列离开之前进入铁路,那么A列在B列离开之前不能离开。下图说明了问题所在。徐书记好像不太聪明的亚子,他不知道怎么解决,所以来求助于你:车站里最多有9列火车,所有的火车都有一个ID(编号从1到N),火车按照O1的顺序进入火车,你的任务是确定火车是否可以按照O2的顺序驶出。\n \u003cbr\u003e \n \u003cimg style\u003d\"max-width:100%;\" src\u003d\"CDN_BASE_URL/e07a7819adc3fce5ee075d011a0a1d3a?v\u003d1608820652\"\u003e \n \u003cimg style\u003d\"max-width:100%;\" src\u003d\"CDN_BASE_URL/3ed5e24625225c0a75f84ac6dbeceabe?v\u003d1608820652\"\u003e \n \u003cimg style\u003d\"max-width:100%;\" src\u003d\"CDN_BASE_URL/b72889e34d63c9ba1c9624e8d50888c9?v\u003d1608820652\"\u003e \n\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":" 徐书记给了你几个例子。每个测试用例由一个整数、列车数和两个字符串组成,列车的顺序为:o1,列车的顺序为:o2。输入被文件结尾终止。在示例输入中提供更多详细信息。\n\u003cbr\u003e"}},{"title":"Output","value":{"format":"HTML","content":" 如果不可以,输出包含一个字符串“No.”。否则输出“Yes.”,然后输出您的交换方式(输出“in”表示一列火车进入铁路,输出“out”表示一列火车离开铁路)。在每个测试之后打印一行包含“FINISH”。\n\u003cbr\u003e"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre\u003e3 123 321\n3 123 312\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre\u003eYes.\nin\nin\nin\nout\nout\nout\nFINISH\nNo.\nFINISH\n\n\n \n \u003ci style\u003d\"font-size:1px\"\u003e \u003c/i\u003e\nFor the first Sample Input, we let train 1 get in, then train 2 and train 3.\nSo now train 3 is at the top of the railway, so train 3 can leave first, then train 2 and train 1.\nIn the second Sample input, we should let train 3 leave first, so we have to let train 1 get in, then train 2 and train 3.\nNow we can let train 3 leave.\nBut after that we can\u0027t let train 1 leave before train 2, because train 2 is at the top of the railway at the moment.\nSo we output \"No.\".\u003c/pre\u003e"}},{"title":"Hint","value":{"format":"HTML","content":"\u003cpre\u003eHint\n \n \u003c/pre\u003e"}}]}