{"trustable":false,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\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 type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"有一个小国家X国,X国有n个城市,城市编号为1-n,X国首都是r1城市。现在X国发生了一些不为人知的政治变动*O*!,首都从r1变动为r2。 变动前,有一个国家地图,包含n - 1个数。国家地图的每一个数a[i](i依次递增,i !\u003d r1)表示 首都r1到 i 城市的路径中所经历的最后一个城市。例如:城市1到目标城市5,路径是1-\u003e3-\u003e2-\u003e5,到目标城市5之前最后一个经历的城市就是2。问,首都发生变动后,新的地图如何表示?"}},{"title":"Input","value":{"format":"HTML","content":"第一行输入三个整数 n, r1, r2, n(2 \u003c\u003d n \u003c\u003d 5e4)表示X国的城市数量, r1表示原首都城市,r2表示变动后的首都城市(1 \u003c\u003d r1 !\u003d r2 \u003c\u003d n)。\n接下来n - 1行,输入原地图,地图含义在题面中已经给出。"}},{"title":"Output","value":{"format":"HTML","content":"输出n - 1个数,表示变动后的新地图。"}},{"title":"Examples","value":{"format":"HTML","content":"\u003cdiv class\u003d\"sample-test\"\u003e\n \u003cdiv class\u003d\"input\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Input\n \u003c/div\u003e\n \u003cpre\u003e3 2 3\u003cbr\u003e2 2\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"output\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Output\n \u003c/div\u003e\n \u003cpre\u003e2 3 \u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"input\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Input\n \u003c/div\u003e\n \u003cpre\u003e6 2 4\u003cbr\u003e6 1 2 4 2\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"output\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Output\n \u003c/div\u003e\n \u003cpre\u003e6 4 1 4 2 \u003c/pre\u003e\n \u003c/div\u003e\n\u003c/div\u003e"}}]}