One Node is Gone
시간 제한1초메모리 제한1024 MB
주어진 트리가 완전 이진 트리에서 루트가 아닌 정점 하나를 제거해 만들어진 것인지 판정하고, 가능한 제거된 정점의 부모를 모두 구한다.
문제
You have an integer . Let's define following tree generation as McDic's generation:
- Make a complete and full binary tree of vertices. Complete and full binary tree means a tree that exactly one vertex is a root, all leaves have the same depth (distance from the root), and all non-leaf nodes have exactly two child nodes.
- Select a non-root vertex from that binary tree.
- Remove from tree and make new edges between 's parent and 's direct children. If has no children, then no new edges will be made.
You have a tree. Determine if this tree can be made by McDic's generation. If yes, then find the parent vertex of removed vertex in tree.
입력
The first line contains integer ().
The -th of the next lines contains two integers and () --- meaning there is an edge between and . It is guaranteed that the given edges form a tree.
출력
Print two lines.
In the first line, print a single integer --- the number of answers. If given tree cannot be made by McDic's generation, then print .
In the second line, print all possible answers in ascending order, separated by spaces. If the given tree cannot be made by McDic's generation, then don't print anything.
힌트
In the first example, is the only possible answer.

In the second example, there are possible answers.

In the third example, the tree can't be generated by McDic's generation.