#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>

using namespace std;
using namespace __gnu_pbds;

template <class T> void mini(T &l, T r) {l = min(l, r);}
template <class T> void maxi(T &l, T r) {l = max(l, r);}

template <class T> using Tree = tree <T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;

string to_string(string s) {
    return '"' + s + '"';
}

string to_string(bool a) {
    return a ? "T" : "F";
}

string to_string(const char* s) {
    return to_string((string) s);
}

template <typename A, typename B>
string to_string(pair<A, B> p) {
    return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}

template <typename A>
string to_string(A v) {
    bool first = true;
    string res = "{";
    for (const auto &x : v) {
        if (!first) {
            res += ", ";
        }
        first = false;
        res += to_string(x);
    }
    res += "}";
    return res;
}

void debug_out() { cerr << endl; }

template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
    cerr << " " << to_string(H);
    debug_out(T...);
}

#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

#define X first
#define Y second

using ll = long long;
using ld = long double;

const int N = 110;
const ll inf = (ll)1e18 + 10;

int n;
int a[N], b[N];
int dep[N];
vector <int> e[N];
vector <int> diag;
int level[N];

void add(int x, int y) {
    e[x].push_back(y);
    e[y].push_back(x);
}

void dfs0(int u, int p) {
    dep[u] = dep[p] + 1;
    for (auto &v : e[u]) {
        if (v != p) dfs0(v, u);
    }
}

void clear() {
    fill_n(level, n + 1, 0);
}

void go(int u, int t, int p, vector <int> &tmp) {
    tmp.push_back(u);
    if (u == t) {
        diag = tmp;
    }
    for (auto &v : e[u]) if (v != p) {
        go(v, t, u, tmp);
    }
    tmp.pop_back();
}

void dfs(int u, int p, int d) {
    debug(u, p, d);
    int cnt = 0;
    for (auto &v : e[u]) if (v != p) {
        dfs(v, u, d + 1);
        cnt += 1;
    }
    debug(cnt, u, level[d], d);
    maxi(level[d], cnt);
}

void run() {
    cin >> n;

    for (int i = 1; i < n; ++i) {
        cin >> a[i] >> b[i];
        add(a[i], b[i]);
    }

    dfs0(1, 0);
    int remote = max_element(dep + 1, dep + n + 1) - dep;
    dfs0(remote, 0);
    int remote2 = max_element(dep + 1, dep + n + 1) - dep;
    vector <int> tmp;
    go(remote, remote2, 0, tmp);

    int z = diag.size();
    ll ans1 = n, ans2 = inf;
    ans1 = (z + 1) / 2;
    debug(diag);
    if (z % 2 == 0) {
        clear();
        dfs(diag[ans1 - 1], diag[ans1], 1);
        dfs(diag[ans1], diag[ans1 - 1], 1);
        ans2 = 2;
        for (int i = 1; i < ans1; ++i) {
            debug(level[i]);
            ans2 *= level[i];
        }
    } else {
        int rt = diag[ans1 - 1];
        clear();
        dfs(rt, 0, 1);
        {
            ans2 = 1;
            for (int i = 1; i < ans1; ++i) {
                ans2 *= level[i];
            }
        }
        for (int x : e[rt]) {
            clear();
            dfs(x, rt, 1);
            dfs(rt, x, 1);
            ll tmp = 2;
            for (int i = 1; i < ans1; ++i) {
                tmp *= level[i];
            }
            mini(ans2, tmp);
        }
    }

    cout << ans1 << " " << ans2 << endl;

}

int main() {
    run();
    return 0;
}


Measured memory_bytes: 384