import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
class implemento {
static int n;
static int k;
static ArrayList<Integer> child[];
static long default_[][];
String p
[]=br.
readLine().
split(" "); //stores the adjacency list for the tree
ArrayList
<Integer
> adjacency
[]=new ArrayList[n
];
for(int i=0;i<n;i++) adjacency[i]=new ArrayList<Integer>();
//reading edges (w,v) for the input tree
for(int i=1;i<n;i++){
String p1
[]=br.
readLine().
split(" "); adjacency[v].add(w);
adjacency[w].add(v);
}
//lines 29 through initialize the given tree as a linked data structure
Stack<Integer> temp=new Stack<Integer>();
temp.push(0);
boolean trav[]=new boolean[n];
trav[0]=true;
for(int i=0;i<n;i++){
child[i]=new ArrayList<Integer>();
}
int parent[]=new int[n];
parent[0]=-1;
while(temp.size()>0){
int x=temp.peek();
int l2=adjacency[x].size();boolean change =false;
for(int u=0;u<l2;u++){
int v=adjacency[x].get(u);
if(!trav[v]){
parent[v]=x;
temp.push(v);
change=true;
trav[v]=true;
break;
}
}
if(!change){temp.pop();}
}
for(int i=0;i<n;i++){
if(parent[i]>=0){
child[parent[i]].add(i);}
}
GenericTreeNode root=initialize(0);
default_=new long[2][k+1];
default_[0][0]=1;
default_[1][0]=1;
long a[][]=getSubtreeInclude_Exclude(root);
//a[0] is the exclude array
//a[1] is the include array
long sum=0;
for(int i=0;i<=k;i++){
sum+=a[0][i]+a[1][i];
}
for(int i=0;i<2;i++){
for(int j=0;j<=k;j++)
System.
out.
print(a
[i
][j
]+" ");
}
}
//function to initialise the given tree
static GenericTreeNode initialize(int root){
if(child[root].size()==0){
return new GenericTreeNode(root);
}
else{int l=child[root].size();
GenericTreeNode temp=new GenericTreeNode(root);
for(int i=0;i<l;i++){
GenericTreeNode t=initialize(child[root].get(i));
temp.children.add(t);
}
return temp;
}
}
// display the given tree
static void display(GenericTreeNode root){
System.
out.
println(root.
node); if(!(root.children.size()==0||root.children==null))
{
int l=root.children.size();
for(int i=0;i<l;i++){
display(root.children.get(i));
}
}
}
//finds the number of valid subtrees
static long[][] getSubtreeInclude_Exclude(GenericTreeNode root){
if(root.children.size()==0||root.children==null) {
//base case when tree is just a node with no children
//return include as[1,0,0,0...]
//return exclude as[1,0,0,0...]
return default_;
}
else{
GenericTreeNode L=root.children.get(0);
root.children.remove(L);
long l[][]=getSubtreeInclude_Exclude(L);
long r[][]=getSubtreeInclude_Exclude(root);
long tvInclude[]=new long[k+1];
long tvExclude[]=new long[k+1];
tvExclude[0]=1;
tvInclude[0]=1;
for(int i=1;i<=k;i++){
tvExclude[i]=l[0][i]+r[1][i-1]+r[0][i];
}
for(int i=1;i<=k;i++){
long sum=0;
for(int j=0;j<=i;j++){
int k1=i-j;
sum+=(l[1][j]*r[1][k1]);
}
tvInclude[i]=l[1][i-1]+sum;
}
long ret[][]=new long[2][k+1];
ret[0]=tvExclude;
ret[1]=tvInclude;
//return the include/exclude arrays for this step
return ret;
}
}
}
class GenericTreeNode{
int node;
ArrayList<GenericTreeNode> children;
GenericTreeNode(){
children=new ArrayList<GenericTreeNode>();
node=0;
}
GenericTreeNode(int n){
children=new ArrayList<GenericTreeNode>();
node=n;
}
}