#include#include using namespace std;#define M 1000005int next[M];char s[M];void getnext(){ int i=0,j=-1; next[0]=-1; int len=strlen(s); while(i 0&&n) { scanf("%s",s); getnext(); printf("Test case #%d\n",++text); int i,j=0; int len=strlen(s); for(i=1;i