#include<iostream>
#include<cstdio>
#include<vector>
#include<cstring>
using namespace std;
long long n,x,y,mx[111],a,b;
pair<long long,long long> ans;
vector<long long> g[111];
void dfs(long long i,long long fa,long long dep)
{
	long long s=0;
	for (long long j=0;j<g[i].size();j++)
	{
		long long to=g[i][j];
		if (to==fa) continue;
		dfs(to,i,dep+1);
		s++;
	}
	mx[dep]=max(mx[dep],s);
}
int main()
{
	ans=make_pair(1e9,1e9);
	cin>>n;
	for (long long i=1;i<n;i++)
	{
		cin>>x>>y;
		g[x].push_back(y);
		g[y].push_back(x);  
	}
	for (long long i=1;i<=n;i++)
	{
		memset(mx,0,sizeof(mx));
		dfs(i,0,1);
		a=1;
		for (b=1;mx[b];b++)
		{
			a*=mx[b];
		}
		ans=min(ans,make_pair(b,a));
	}
	for (long long i=1;i<=n;i++)
	{
		for (long long j=0;j<g[i].size();j++)
		{
			memset(mx,0,sizeof(mx));
			dfs(i,g[i][j],1);
			dfs(g[i][j],i,1);
			a=2;
			for (b=1;mx[b];b++)
			{
				a*=mx[b];
			}
			ans=min(ans,make_pair(b,a));
		}
	}
	cout<<ans.first<<" "<<ans.second<<endl;
	return 0;
}