{"raw_statement":[{"iden":"problem statement","content":"A graph with $(k+1)$ vertices and $k$ edges is called a level-$k\\ (k\\geq 2)$ star if and only if:\n\n*   it has a vertex that is connected to each of the other $k$ vertices with an edge, and there are no other edges.\n\nAt first, Takahashi had a graph consisting of stars. He repeated the following operation until every pair of vertices in the graph was connected:\n\n*   choose two vertices in the graph. Here, the vertices must be disconnected, and their degrees must be both $1$. Add an edge that connects the chosen two vertices.\n\nHe then arbitrarily assigned an integer from $1$ through $N$ to each of the vertices in the graph after the procedure. The resulting graph is a tree; we call it $T$. $T$ has $(N-1)$ edges, the $i$\\-th of which connects $u_i$ and $v_i$.\nTakahashi has now forgotten the number and levels of the stars that he initially had. Find them, given $T$."},{"iden":"constraints","content":"*   $3\\leq N\\leq 2\\times 10^5$\n*   $1\\leq u_i, v_i\\leq N$\n*   The given graph is an $N$\\-vertex tree obtained by the procedure in the problem statement.\n*   All values in the input are integers."},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$N$\n$u_1$ $v_1$\n$\\vdots$\n$u_{N-1}$ $v_{N-1}$"},{"iden":"sample input 1","content":"6\n1 2\n2 3\n3 4\n4 5\n5 6"},{"iden":"sample output 1","content":"2 2\n\nTwo level-$2$ stars yield $T$, as the following figure shows:\n![image](https://img.atcoder.jp/abc303/59ab8e04c23d5f727300be7544b1df7e.png)"},{"iden":"sample input 2","content":"9\n3 9\n7 8\n8 6\n4 6\n4 1\n5 9\n7 3\n5 2"},{"iden":"sample output 2","content":"2 2 2"},{"iden":"sample input 3","content":"20\n8 3\n8 18\n2 19\n8 20\n9 17\n19 7\n8 7\n14 12\n2 15\n14 10\n2 13\n2 16\n2 1\n9 5\n10 15\n14 6\n2 4\n2 11\n5 12"},{"iden":"sample output 3","content":"2 3 4 7"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}