#include #include #include #include #include #include #include #include #include #include using namespace std; struct aaa{aaa(){cin.tie(nullptr); ios::sync_with_stdio(false); cout<ostream &operator<<(ostream &o,const vector&v){o<<"{";for(int i=0;i<(int)v.size();i++)o<<(i>0?", ":"")<> n; while(true) { int t = 0, nn = n; while(nn!=0) t+=nn%10,nn/=10; if (n == t) break; n = t; } cout << n << endl; }