import sys
input = sys.stdin.readline
sys.setrecursionlimit(10000)
from collections import deque, Counter, defaultdict
def getN():
    return int(input())
def getList():
    return list(map(int, input().split()))
import math
MOD = 10**9 + 7
INF = 10**20



def dfs(S, F, depth, v, d, graph):
    F[v] = len(S)
    depth[v] = d
    S.append(v)
    for w in graph[v]:
        dfs(S, F, depth, w, d+1, graph)
        S.append(v)


def main():
    n,a,b = getList()
    graph = [[] for i in range(n)]
    for _ in range(n-1):
        v1, v2 = getList()
        graph[v1 - 1].append(v2 - 1)
        graph[v1 - 1].append(v2 - 1)

    S = []
    F = [0] * n
    depth = [0] * n
    dfs(S, F, depth, 0, 0, graph)

    print(S)
    # ret = eulertour(graph)
    # print(ret)

    # revidx = [-1 for i in range(n)]
    # for i, point in enumerate(ret):
    #     if revidx[point[1]] == -1:
    #         revidx[point[1]] = i
    #
    # seg = Segtree_op(len(ret))
    # for i, r in enumerate(ret):
    #     seg.update(i,r)
    #
    # # print(revidx)
    #
    # seg.show()

    # for _ in range(q):
    #     ql, qr = getList()
    #     segl, segr = revidx[ql], revidx[qr]
    #     if segl > segr:
    #         segl, segr = segr, segl

        # print(seg.query(segl, segr)[1])
if __name__ == "__main__":
    main()