#include<stdio.h>
#include<string.h>
#include<stdlib.h>
char s[200000][10];
int cmp(const void * _a,const void *_b)
{
char * a=(char *) _a;
char * b=(char *) _b;
return strcmp(a,b);
}
int main()
{
int i=0;int num=0;
int ok=0;
while(scanf("%s",s[i++])==1)
{
if(s[i-1][0]=='9')
{
qsort(s,i-1,sizeof(s[0]),cmp);
int j;
for(j=0;j<i-1;j++)
{
char *pos=strstr(s[j+1],s[j]);
if(pos==s[j+1])
{
ok=0;
}
else ok=1;
if(ok==0) break;
}
if(ok==1) printf("Set %d is immediately decodable\n",++num);
else printf("Set %d is not immediately decodable\n",++num);
ok=0;
i=0;
}
}
return 0;
}
23333333