func_code_string: #include <bits/stdc++.h>   using namespace std;   class Node {    public:     vector<int> kids;     int pos[26];     int size;     int depth;     Node() {       this->size = 0;       memset(pos, 0, sizeof(pos));     }     void push(int kid, int next) {       this->kids.push_back(kid);       pos[next] = this->kids.size();     }   } N[300005];   int n, x, y;   char c;   int maxdepth;   int reduce[300005];   void init(int id) {     N[id].size = 1;     int l = N[id].kids.size();     for (int i = 0; i < l; i++) {       N[N[id].kids[i]].depth = N[id].depth + 1;       init(N[id].kids[i]);       maxdepth = max(maxdepth, N[N[id].kids[i]].depth);       N[id].size += N[N[id].kids[i]].size;     }   }   int dfsS(vector<int> &kids) {     if (kids.size() <= 1) return 0;     int ret = kids.size() - 1;     int l = kids.size();     int pos;     vector<int> tmp;     for (int i = 0; i < 26; i++) {       for (int j = 0; j < l; j++) {         pos = N[kids[j]].pos[i];         if (pos) {           tmp.push_back(N[kids[j]].kids[pos - 1]);         }       }       if (tmp.size() > 1) ret += dfsS(tmp);       tmp.clear();     }     return ret;   }   void dfsD(int id) {     int l = N[id].kids.size();     int ret = l ? 1 : 0;     ret += dfsS(N[id].kids);     reduce[N[id].depth + 1] += ret;     for (int i = 0; i < l; i++) {       dfsD(N[id].kids[i]);     }   }   int main() {     cin >> n;     for (int i = 0; i < n - 1; i++) {       cin >> x >> y >> c;       N[x].push(y, c -  a );     }     N[1].depth = 0;     init(1);     dfsD(1);     int mm = 0;     int ans = 0;     for (int i = 1; i <= maxdepth; i++) {       if (reduce[i] > mm) {         ans = i;         mm = reduce[i];       }     }     cout << N[1].size - mm << endl;     cout << ans;     return 0;   };   