long ab[200000]; long cd[200000]; char xx[200000]; int en[100001]; int ei[100001]; int eb[400000]; int z[100001]; int d; void f(int i){ if(!z[i]){ z[i]=d; for(int k=0;k>32; int b=ab[i]; eb[ei[a]+en[a]++]=b; eb[ei[b]+en[b]++]=a; } } d=-1; f(1); rrep(i,q){ d=i+1; int a=cd[i]>>32; int b=cd[i]; if(z[a]) f(b); if(z[b]) f(a); eb[ei[a]+en[a]++]=b; eb[ei[b]+en[b]++]=a; } wtLn(((z+2))(n-1)); }