#include using namespace std; #define int long long #define pb push_back #define fi first #define se second #define FOR(i,n) for(int i = 0;i=(s);i--) #define all(v) (v).begin(),(v).end() #define chmin(a,b) a=min((a),(b)) #define chmax(a,b) a=max((a),(b)) #define endl '\n' #define IOS() ios_base::sync_with_stdio(0);cin.tie(0) typedef long long ll; typedef pairpint; typedef vectorvint; typedef vectorvpint; const ll MOD=1000000007,INF=1ll<<60; typedef vectorvvint; int N; vint g[100010]; int dist[100010]; void dfs(int now,int par){ for(auto e:g[now]){ if(e==par)continue; dist[e]=dist[now]+1; dfs(e,now); } } signed main() { IOS(); cin>>N; rep(i,0,N-1){ int a,b; cin>>a>>b; a--;b--; g[a].pb(b); g[b].pb(a); } dfs(0,-1); int t=-1,ma; rep(i,0,N){ if(t