#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<double,double> pdd;
#define IOS ios_base::sync_with_stdio(0); cin.tie(0)
#define ALL(a) a.begin(),a.end()
#define SZ(a) ((int)a.size())
#define F first
#define S second
#define REP(i,n) for(int i=0;i<((int)n);i++)
#define pb push_back
#define MP(a,b) make_pair(a,b)
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#ifdef leowang
#define debug(...) do{\
	fprintf(stderr,"%s - %d : (%s) = ",__PRETTY_FUNCTION__,__LINE__,#__VA_ARGS__);\
	_DO(__VA_ARGS__);\
}while(0)
template<typename I> void _DO(I&&x){cerr<<x<<endl;}
template<typename I,typename...T> void _DO(I&&x,T&&...tail){cerr<<x<<", ";_DO(tail...);}
#else
#define debug(...)
#endif
template<typename T1,typename T2>
ostream& operator<<(ostream& out,pair<T1,T2> P){
	out<<'('<<P.F<<','<<P.S<<')';
	return out;
}
//}}}
const ll maxn=105;
const ll maxlg=__lg(maxn)+2;
const ll INF64=8000000000000000000LL;
const int INF=2000000000;
const ll MOD=ll(1e9+7);
const double PI=acos(-1);
//const ll p=880301;
//const ll P=31;

ll mypow(ll a,ll b){
	ll res=1LL;
	while(b){
		if(b&1) res=res*a%MOD;
		a=a*a%MOD;
		b>>=1;
	}
	return res;
}

vector<int> child[maxn];
bool vis[maxn];
int dp[maxn];

int dfs(int u,int d){
    vis[u]=1;
    int ret=d;
    for(int v:child[u]) if(!vis[v]){
        ret=max(dfs(v,d+1),ret);
    }
    return ret;
}

int sz[maxn];

void dfs2(int u,int d){
    vis[u]=1;
    int cnt=0;
    for(int v:child[u]) if(!vis[v]){
        cnt++;
        dfs2(v,d+1);
    }
    sz[d]=max(sz[d],cnt);
}

int edfs(int u,int fb,int d){
    vis[u]=1;
    int ret=d;
    for(int v:child[u]) if(!vis[v]&&v!=fb){
        ret=max(ret,edfs(v,fb,d+1));
    }
    return ret;
}
void edfs2(int u,int fb,int d){
    vis[u]=1;
    int cnt=0;
    for(int v:child[u]) if(!vis[v]&&v!=fb){
        cnt++;
        edfs2(v,fb,d+1);
    }
    sz[d]=max(sz[d],cnt);
}

ll solve(int u,int bst){
    REP(i,maxn) sz[i]=0;
    REP(i,maxn) vis[i]=0;
    dfs2(u,1);
    ll ret=1;
    for(int i=1;i<bst;i++) ret*=sz[i];
    return ret;
}
ll esolve(int u,int v,int bst){
    REP(i,maxn) sz[i]=0;
    REP(i,maxn) vis[i]=0;
    edfs2(u,v,1);
    edfs2(v,u,1);
    ll ret=1;
    for(int i=1;i<bst;i++) ret*=sz[i];
    //for(int i=1;i<=bst;i++) cout<<sz[i]<<" \n"[i==bst];
    //cout<<u<<' '<<v<<' '<<ret<<'\n';
    return ret;
}
vector<pii> edge;
int ed[maxn];
int main()
{
	IOS;
	int n;
	cin>>n;
	REP(i,n-1){
	    int u,v;
	    cin>>u>>v;
	    u--;v--;
	    child[u].pb(v);
	    child[v].pb(u);
	    edge.pb(MP(u,v));
	}
	REP(i,n){
	    REP(j,n) vis[j]=0;
	    dp[i]=dfs(i,1);
	    //cout<<dp[i]<<" \n"[i==n-1];
	}
	REP(i,n-1){
	    REP(j,n) vis[j]=0;
	    ed[i]=max(edfs(edge[i].F,edge[i].S,1),edfs(edge[i].S,edge[i].F,1));
	    //cout<<edge[i].F<<' '<<edge[i].S<<' '<<ed[i]<<"\n";
	}
	
	int bstd=INF;
	REP(i,n) bstd=min(bstd,dp[i]);
	REP(i,n-1) bstd=min(bstd,ed[i]);
	cout<<bstd<<' ';
	ll ans2=INF64;
	REP(i,n) if(dp[i]==bstd){
	    ans2=min(ans2,solve(i,bstd));
	}
	REP(i,n-1) if(ed[i]==bstd){
	    ans2=min(ans2,2*esolve(edge[i].F,edge[i].S,bstd));
	}
	cout<<ans2<<'\n';
	return 0;
}


Measured memory_bytes: 256