func_code_string: #include <bits/stdc++.h>   using namespace std;   const int mod = 998244353;   const int N = 1e5 + 5;   vector<int> g[N];   vector<pair<int, int> > ans;   int maxx;   void dfs(int x, int fa, int t) {     int siz = g[x].size();     int tmp = t;     ans.push_back(make_pair(x, t));     for (int i = 0; i <= siz - 1; i++) {       int v = g[x][i];       if (v == fa) continue;       if (t == maxx) t = maxx - siz, ans.push_back(make_pair(x, t));       dfs(v, x, ++t);       ans.push_back(make_pair(x, t));     }     if (t >= tmp && x - 1) ans.push_back(make_pair(x, tmp - 1));   }   int main() {     int n, x, y;     scanf( %d , &n);     for (int i = 1; i <= n - 1; i++) {       scanf( %d%d , &x, &y);       g[x].push_back(y);       g[y].push_back(x);     }     for (int i = 1; i <= n; i++) maxx = max(maxx, (int)g[i].size());     dfs(1, 1, 0);     int num = (int)ans.size();     printf( %d n , num);     for (int i = 0; i <= num - 1; i++) {       printf( %d %d n , ans[i].first, ans[i].second);     }     return 0;   }   