{"trustable":true,"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 loves animals very much. Recently, she purchased $$$n$$$ kittens, enumerated them from $$$1$$$ and $$$n$$$ and then put them into the cage. The cage consists of one row of $$$n$$$ cells, enumerated with integers from $$$1$$$ to $$$n$$$ from left to right. Adjacent cells had a partially transparent partition wall between them, hence there were $$$n - 1$$$ partitions originally. Initially, each cell contained exactly one kitten with some number.\u003c/p\u003e\u003cp\u003eObserving the kittens, Asya noticed, that they are very friendly and often a pair of kittens in neighboring cells wants to play together. So Asya started to remove partitions between neighboring cells. In particular, on the day $$$i$$$, Asya:\u003c/p\u003e\u003cul\u003e \u003cli\u003e Noticed, that the kittens $$$x_i$$$ and $$$y_i$$$, located in neighboring cells want to play together. \u003c/li\u003e\u003cli\u003e Removed the partition between these two cells, efficiently creating a single cell, having all kittens from two original cells. \u003c/li\u003e\u003c/ul\u003e\u003cp\u003eSince Asya has never putted partitions back, after $$$n - 1$$$ days the cage contained a single cell, having all kittens.\u003c/p\u003e\u003cp\u003eFor every day, Asya remembers numbers of kittens $$$x_i$$$ and $$$y_i$$$, who wanted to play together, however she doesn\u0027t remember how she placed kittens in the cage in the beginning. Please help her and find any possible initial arrangement of the kittens into $$$n$$$ cells.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line contains a single integer $$$n$$$ ($$$2 \\le n \\le 150\\,000$$$)\u0026nbsp;— the number of kittens.\u003c/p\u003e\u003cp\u003eEach of the following $$$n - 1$$$ lines contains integers $$$x_i$$$ and $$$y_i$$$ ($$$1 \\le x_i, y_i \\le n$$$, $$$x_i \\ne y_i$$$)\u0026nbsp;— indices of kittens, which got together due to the border removal on the corresponding day.\u003c/p\u003e\u003cp\u003eIt\u0027s guaranteed, that the kittens $$$x_i$$$ and $$$y_i$$$ were in the different cells before this day.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eFor every cell from $$$1$$$ to $$$n$$$ print a single integer\u0026nbsp;— the index of the kitten from $$$1$$$ to $$$n$$$, who was originally in it.\u003c/p\u003e\u003cp\u003eAll printed integers must be distinct.\u003c/p\u003e\u003cp\u003eIt\u0027s guaranteed, that there is at least one answer possible. In case there are multiple possible answers, print any of them.\u003c/p\u003e"}},{"title":"Examples","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\u003eThe answer for the example contains one of several possible initial arrangements of the kittens.\u003c/p\u003e\u003cp\u003eThe picture below shows how the cells were united for this initial arrangement. Note, that the kittens who wanted to play together on each day were indeed in \u003cspan class\u003d\"tex-font-style-bf\"\u003eadjacent cells\u003c/span\u003e.\u003c/p\u003e\u003ccenter\u003e \u003cimg class\u003d\"tex-graphics\" src\u003d\"CDN_BASE_URL/c08333a4a070339d7871fe4eb1b61b1b?v\u003d1715563321\" style\u003d\"max-width: 100.0%;max-height: 100.0%;\"\u003e \u003c/center\u003e"}}]}