#include using namespace std; int main(){ cin.tie(0),ios::sync_with_stdio(false); int t; cin>>t; for(int i=0;i>s; while(s.size()>1){ string r=s; s=""s; for(int j=1;j