use std::collections::VecDeque;

fn main() {
    ioset! { inp, buf }
    macro_rules! scan {
        ($($r:tt)*) => {
            input! { inp, $($r)* }
        }
    }
    macro_rules! print {
        ($($t:expr),*) => {
            write!(buf, $($t),*).unwrap();
        } 
    }

    scan! {
        N: usize,
        E: [(usize1, usize1); N - 1],
    }

    let mut g = vec![Vec::new(); N];
    for (a, b) in E.iter() {
        g[*a].push(*b);
        g[*b].push(*a);
    }
    let mut ans = (N + 1, 0);
    for s in 0..N {
        let mut que = Vec::new();
        let mut res = Vec::new();
        que.push((s, N, 0));
        while let Some((v, f, c)) = que.pop() {
            if res.len() == c {
                res.push(g[v].len() - 1);
            }
            else if res[c] < g[v].len() - 1 {
                res[c] = g[v].len() - 1;
            }
            for t in g[v].iter() {
                if f != *t {
                    que.push((*t, v, c + 1));
                }
            }
        }
        let mut leave = 1;
        res[0] += 1;
        res.pop();
        for x in res.iter()  {
            leave *= x;
        }
        ans = std::cmp::min(ans, (res.len() + 1, leave));
    }
    for (a, b) in E {
        let mut que = Vec::new();
        let mut res = Vec::new();
        que.push((a, b, 0));
        que.push((b, a, 0));
        while let Some((v, f, c)) = que.pop() {
            if res.len() == c {
                res.push(g[v].len() - 1);
            }
            else if res[c] < g[v].len() - 1 {
                res[c] = g[v].len() - 1;
            }
            for t in g[v].iter() {
                if f != *t {
                    que.push((*t, v, c + 1));
                }
            }
        }
        let mut leave = 1;
        res.pop();
        for x in res.iter()  {
            leave *= x;
        }
        ans = std::cmp::min(ans, (res.len() + 1, leave * 2));
    }
    let (a, b) = ans;
    println!("{} {}\n", a, b);
}

use std::io::{ stdout, BufWriter, Write };

#[macro_export]
macro_rules! ioset {
    ($inp:ident, $buf:ident) => {
        inset!($inp);
        outset!($buf);
    }
}

#[macro_export]
macro_rules! inset {
    (source = $s:expr, $iter:ident) => {
        let mut $iter = $s.split_whitespace();
    };
    ($iter:ident) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut $iter = s.split_whitespace();
    }
}

#[macro_export]
macro_rules! input {
    ($iter:expr) => {};
    ($iter:expr, ) => {};
    ($iter:expr, $var:ident : $t:tt, $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input! { $iter, $($r)* }
    };
    ($iter:expr, mut $var:ident : $t:tt, $($r:tt)*) => {
        let mut $var = read_value!($iter, $t);
        input! { $iter, $($r)* }
    };
    ($iter:expr, ($var:expr) : $t:tt, $($r:tt)*) => {
        $var = read_value!($iter, $t);
        input! { $iter, $($r)* }
    };
}

#[macro_export]
macro_rules! read_value {

    // tuple
    ($iter:expr, ( $($t:tt), * )) => {
        ( $(read_value!($iter, $t)), * )
    };
    
    // array
    ($iter:expr, [ $t:tt; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };
    
    // string
    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        $iter.next().unwrap().parse::<usize>().expect("Parse error") - 1
    };
    
    // any other
    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

#[macro_export]
macro_rules! outset {
    ($buf:ident) => {
        let sout = stdout();
        let mut $buf = BufWriter::new(sout.lock());
    }
}

#[macro_export]
macro_rules! output {
    ($buf:expr, $($t:expr),*) => {
        write!($buf, $($t),*).unwrap();
    }
}

struct Chars<'a>(&'a Vec<char>);

impl<'a> std::fmt::Display for Chars<'a> {
    fn fmt(&self, f: &mut std::fmt::Formatter) -> Result<(), std::fmt::Error> {
        write!(f, "{}", self.0.iter().collect::<String>())
    }
}


Measured memory_bytes: 2196