#include #include #include using namespace std; const int N = 1e4 + 10; char st[N]; int main(){ int T;scanf("%d",&T); for (;T--;){ scanf("%s",st); int len = strlen(st); for (int i=len;i>0;i--){ st[i] = st[i-1]; } int ans = 0; for (int i=1;i