#include <map>
#include <set>
#include <ctime>
#include <queue>
#include <stack>
#include <cmath>
#include <vector>
#include <bitset>
#include <cstdio>
#include <cctype>
#include <string>
#include <numeric>
#include <cstring>
#include <cassert>
#include <climits>
#include <cstdlib>
#include <iostream>
#include <algorithm>
#include <functional>
using namespace std ;
#define rep(i, a, b) for (register ll i = (a); i <= (b); ++i)
#define per(i, a, b) for (register ll i = (a); i >= (b); --i)
#define loop(it, v) for (auto it = v.begin(); it != v.end(); it++)
#define cont(i, x) for (register ll i = head[x]; i; i = edge[i].nex)
#define clr(a) memset(a, 0, sizeof(a))
#define ass(a, cnt) memset(a, cnt, sizeof(a))
#define cop(a, b) memcpy(a, b, sizeof(a))
#define lowbit(x) (x & -x)
#define all(x) x.begin(), x.end()
#define SC(t, x) static_cast <t> (x)
#define ub upper_bound
#define lb lower_bound
#define pqueue priority_queue
#define mp make_pair
#define pb push_back
#define pof pop_front
#define pob pop_back
#define fi first
#define se second
#define y1 y1_
#define Pi acos(-1.0)
#define iv inline void
#define enter putchar('\n')
#define siz(x) ((int)x.size())
#define file(x) freopen(x".in", "r", stdin),freopen(x".out", "w", stdout)
typedef double db ;
typedef long long ll ;
typedef unsigned long long ull ;
typedef pair <int, int> pii ;
typedef vector <int> vi ;
typedef vector <pii> vii ;
typedef queue <int> qi ;
typedef queue <pii> qii ;
typedef set <int> si ;
typedef map <int, int> mii ;
typedef map <string, int> msi ;
const int maxn = 2e6 + 100 ;
const int inf = 0x3f3f3f3f ;
const int iinf = 1 << 30 ;
const ll linf = (ll)(1) << (ll)(60) ;
const ll mod = 998244353 ;
const double eps = 1e-7 ;
template <class T = ll> T read()
{
	T f = 1, a = 0;
	char ch = getchar() ;
	while (!isdigit(ch)) { if (ch == '-') f = -1 ; ch = getchar() ; }
	while (isdigit(ch)) { a =  (a << 3) + (a << 1) + ch - '0' ; ch = getchar() ; }
	return a * f ;
}

void write(ll a)
{
	if(a > 9) write(a / 10);
	putchar('0' + a % 10);
}

ll n;

pair <ll, ll> e[105];

vector <ll> edge[105];

ll maxx, ans = linf;

ll sum[105];

ll find_len(ll now, ll fa)
{
	ll ret = 1;
	for(ll to : edge[now])
	{
		if(to == fa) continue;
		ret = max(ret, find_len(to, now) + 1);
	}
	return ret;
}

void find_max(ll now, ll fa, ll dis)
{
	ll tmp = 0;
	for(ll to : edge[now])
	{
		if(to == fa) continue;
		tmp ++;
		find_max(to, now, dis + 1);
	}
	sum[dis] = max(sum[dis], tmp);
}

void get_ans()
{
	rep(i, 1, n - 1)
	{
		ll lim = max(find_len(e[i].fi, e[i].se), find_len(e[i].se, e[i].fi));
		if(lim <= maxx / 2)
		{
			clr(sum);
			find_max(e[i].fi, e[i].se, 1), find_max(e[i].se, e[i].fi, 1);
			ll tmp = 2;
			rep(j, 1, lim - 1) tmp = min(tmp * sum[j], linf);
			ans = min(ans, tmp);
		}
	}
}

signed main()
{
	n = read();
	if(n == 1) return puts("1 1"), 0;
	rep(i, 1, n - 1)
	{
		e[i].fi = read(), e[i].se = read();
		edge[e[i].fi].pb(e[i].se), edge[e[i].se].pb(e[i].fi);
	}
	rep(i, 1, n) maxx = max(maxx, find_len(i, 0));
	if(!(maxx & 1)) get_ans();
	else
	{
		maxx ++;
		rep(i, 1, n)
		{
			ll flag = 0;
			for(ll to : edge[i])
			{
				ll tmp = find_len(to, i);
				if(tmp == maxx / 2 - 1) flag ++;
			}
			if(flag < 2) continue;
			clr(sum);
			for(ll to : edge[i]) find_max(to, i, 1);
			ll tmp = siz(edge[i]);
			rep(j, 1, maxx / 2 - 2) tmp = min(tmp * sum[j], linf);
			ans = min(ans, tmp);
		}
		get_ans();
	}
	write(maxx / 2), putchar(' '), write(ans), enter;
	return 0;
}

/*
15
1 2
1 3
1 4
3 5
5 6
1 7
1 8
1 9
4 10
1 11
7 12
8 13
12 14
8 15
*/

Measured memory_bytes: 256