Problem B: Leaves

Problem B: Leaves

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 1173  Solved: 566
[Submit][Status][Web Board]

Description

Given a tree whose nodes are numbered from 1 to \(n\). You are asked to print all the leaf nodes of the tree in ascending order. The root of the tree is node 1.

Input

The first line contains one integer \(n\) \((1\le n \le 1\ 000\ 000)\), indicating the number of nodes in the tree.

Then \(n-1\) lines follow. Each line contains two integers \(u,v\) \((1 \le u, v \le n)\) describing an edge, indicating the indices of nodes which form an edge.

Output

One line contains integers in ascending order.Multiple integers in one line must be separated by one space.

Sample Input

4
1 2
1 3
3 4

Sample Output

2 4

HINT

[Submit][Status]