human
Asya 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.

Observing 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:

  * Noticed, that the kittens x_i and y_i, located in neighboring cells want to play together. 
  * Removed the partition between these two cells, efficiently creating a single cell, having all kittens from two original cells. 


Since Asya has never putted partitions back, after n - 1 days the cage contained a single cell, having all kittens.

For every day, Asya remembers numbers of kittens x_i and y_i, who wanted to play together, however she doesn't 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.

Input

The first line contains a single integer n (2 ≤ n ≤ 150 000) — the number of kittens.

Each of the following n - 1 lines contains integers x_i and y_i (1 ≤ x_i, y_i ≤ n, x_i ≠ y_i) — indices of kittens, which got together due to the border removal on the corresponding day.

It's guaranteed, that the kittens x_i and y_i were in the different cells before this day.

Output

For every cell from 1 to n print a single integer — the index of the kitten from 1 to n, who was originally in it.

All printed integers must be distinct.

It's guaranteed, that there is at least one answer possible. In case there are multiple possible answers, print any of them.

Example

Input

5
1 4
2 5
3 1
4 5

Output

3 1 4 2 5

Note

The answer for the example contains one of several...
The above is tricky. Write me a correct solution in PYTHON3.

=====
Can you provide a Python code to find any possible initial arrangement of the kittens into n cells?
assistant
#Here is Python code to find any possible initial arrangement of the kittens into n cells.

#!/usr/bin/env python
"""
This file is part of https://github.com/cheran-senthil/PyRival
Copyright 2019 Cheran Senthilkumar <hello@cheran.io>

"""
import os
from io import BytesIO

input = BytesIO(os.read(0, os.fstat(0).st_size)).readline

class UnionFind:
    def __init__(self, n):
        self.parent = list(range(n))
        self.size = [1] * n
        self.num_sets = n

    def find(self, a):
        to_update = []

        while a != self.parent[a]:
            to_update.append(a)
            a = self.parent[a]

        for b in to_update:
            self.parent[b] = a

        return self.parent[a]

    def merge(self, a, b):
        a = self.find(a)
        b = self.find(b)

        if a == b:
            return

        if self.size[a] < self.size[b]:
            a, b = b, a

        self.num_sets -= 1
        self.parent[b] = a
        self.size[a] += self.size[b]

    def set_size(self, a):
        return self.size[self.find(a)]

def main():
    n = int(input())

    uf = UnionFind(n + 1)
    res = [[i] for i in range(n + 1)]

    for i in range(n - 1):
        x, y = map(int, input().split())
        ind_x, ind_y = uf.find(x), uf.find(y)

        uf.merge(x, y)
        new_ind = uf.find(x)
        res[new_ind].extend(res[ind_y] if new_ind == ind_x else res[ind_x])

    os.write(1, ' '.join(map(str, max(res, key=len))).encode())

if __name__ == '__main__':
    main()