{"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":"\u003cp\u003eAsya 非常喜欢动物。最近,她买了 $n$ 只小猫,从 $1$ 和 $n$ 开始枚举,然后把它们放到笼子里。笼子由一排 $n$ 个单元组成,从左到右用 $1$ 到 $n$ 的整数列举。相邻的单元格之间有一个部分透明的隔断墙,因此最初有 $n-1$个隔断。最初,每个单元格中正好有一只带有某个数字的小猫。\u003c/p\u003e\n\n\u003cp\u003e在观察小猫时,阿斯亚注意到,它们非常友好,相邻单元的一对小猫经常想一起玩。因此,Asya 开始消除相邻单元之间的隔断。特别是在第 $i$ 天。\u003c/p\u003e\n\n\u003cp\u003e注意到,位于相邻单元的小猫 $x_i$ 和 $y_i$ 想一起玩。\n移除这两个单元之间的隔断,有效地创建了一个单元,拥有两个原始单元的所有小猫。\u003c/p\u003e\n\n\u003cp\u003e由于Asya 从来没有把隔板放回去,在 $n-1$ 天后,笼子里只有一个单元,有所有小猫。\u003c/p\u003e\n\n\u003cp\u003e对于每一天,Asya 都记得小猫 $x_i$ 和 $y_i$ 的数量,它们想在一起玩耍,但是她不记得一开始是如何把小猫放在笼子里的。请帮助她,找出任何可能的初始安排,将小猫放入 $n$ 个单元。\u003c/p\u003e"}},{"title":"输入","value":{"format":"HTML","content":"\u003cp\u003e第一行包含一个整数 $n$ ($2≤n≤150 000$) 表示小猫的数量。\u003c/p\u003e\n\n \u003cp\u003e接下来的 $n-1$ 行包含整数 $x_i$ 和$y_i$ ($1\\leq x_i, y_i\\leq n, x_i≠y_i$) 表示小猫的指数,由于在相应的一天拆除边界,它们聚在一起。\u003c/p\u003e\n\n\u003cp\u003e 可以保证,小猫 $x_i$ 和 $y_i$ 在这一天之前是在不同的单元中。\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":" \u003cp\u003e对于从 $1$ 到 $n$ 的每一个单元格,打印一个整数--从 $1$ 到 $n$ 的小猫的索引,他原来在其中。\u003cp\u003e\n\n \u003cp\u003e所有打印的整数必须是不同的。\u003cp\u003e\n\n \u003cp\u003e我们保证至少有一个可能的答案。如果有多个可能的答案,则打印其中任何一个。\u003cp\u003e"}},{"title":"Sample 1","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\u003e5\n1 4\n2 5\n3 1\n4 5\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e3 1 4 2 5\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Note","value":{"format":"HTML","content":" \u003cp\u003e 这个例子的答案包含了小猫的几种可能的初始排列方式之一。\u003cp\u003e\n\u003cp\u003e 下图显示了这个初始排列的单元格是如何结合在一起的。请注意,每天想在一起玩的小猫确实在相邻的单元格中。\u003cp\u003e\n\u003ccenter\u003e \n \u003cimg class\u003d\"tex-graphics\" src\u003d\"CDN_BASE_URL/c08333a4a070339d7871fe4eb1b61b1b?v\u003d1659464166\" style\u003d\"max-width: 100.0%;max-height: 100.0%;\"\u003e \n\u003c/center\u003e"}}]}