#include using namespace std; using LL=long long; const int mo=1e9+7; LL qpow(LL a,LL b) { LL ans=1; a%=mo; while(b) { if(b&1) ans=ans*a%mo; b>>=1; a=a*a%mo; } return ans; } //---------------------------------- vectorv; int main() { int T; scanf("%d",&T); int n; while(T--) { scanf("%d",&n); v.clear(); int res=0,x,i; x=n; while(x) { res+=x%10; x/=10; } for(i=1;i*i