#include using namespace std; struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star; typedef long long LL; template istream& operator>>(istream &is,vector &v){ for(auto &it:v)is>>it; return is; } templatevoid chmin(T& a, T& b){a=min(a,b);} templatevoid chmax(T& a, T& b){a=max(a,b);} int N; string S; typedef vector V; typedef vector Graph; LL all_c=0,all_w=0; typedef tuple P; P make_tree(int v,int p,Graph& g,Graph &tree,Graph& c_num,Graph& w_num){ // cout<>N>>S; Graph g(N),tree(N),c_num(N),w_num(N); for(int i=1;i>a>>b;a--,b--; g[a].push_back(b); g[b].push_back(a); } tie(all_c,all_w)=make_tree(0,0,g,tree,c_num,w_num); cout<