N,*abs=$<.read.split.map(&:to_i)

h = {}
abs.each_slice(2).with_index(1) do |(a,b),i|
    h[a] ||= []
    h[a] << [b,i]
    h[b] ||= []
    h[b] << [a,i]
end

arr = Array.new(N,0)

# p h

q = [[1,0,0]]
until q.empty?
    b,i,parent = q.shift
    # p [arr,q,[b,i,parent], arr[i]]
    next if arr[i] != 0
    arr[i] = parent

    n = 0
    h[b].each do |c,j|
        next if arr[j] != 0
        n += 1
        n += 1 if n == parent
        q << [c,j,n]
    end
end

arr.shift
puts arr.max, arr