#include #include using namespace std; using namespace atcoder; using ll=long long; #define rep(i,a,b) for(it i=(it)(a);i<=(it)b;i++) #define nrep(i,a,b) for(it i=(it)(a);i>=(it)b;i--) #define all(v) v.begin(), v.end() #define rall(v) v.rbegin(), v.rend() #define moda 998244353LL #define modb 1000000007LL #define dai 2500000000000000000LL #define tyu 2500000000 #define en 3.14159265358979 #define sho -dai #define eps 1e-14 #define yn(x) cout<<(x ? "Yes":"No")<; using mint=modint; using mints=modint998244353; using vi=vector; using vd=vector; using vs=vector; using vc=vector; using vb=vector; using vp=vector

; using vm=vector; using sp=set

; using ss=set; using sc=set; using si=set; using svi=set; using vvi=vector; using vvd=vector; using vvs=vector; using vvb=vector; using vvc=vector; using vvp=vector; using vvm=vector; using vsi=vector; using vsp=vector; using vvsi=vector; using vvsp=vector; using vvvi=vector; using vvvd=vector; using vvvm=vector; using vvvvi=vector; int main(){ it t;cin>>t; rep(i,1,t){ st s;cin>>s; vi a(s.size()); rep(j,0,s.size()-1)a[j]=s[j]-'0'; while(a.size()!=1){ vi b; rep(j,0,a.size()-2) b.push_back((a[j]+a[j+1])/10+(a[j]+a[j+1])%10); a=b; } cout<