/*   @JUDGE_ID:   1705PZ   644   C */
#include <stdio.h>
#include <string.h>

void main()
{
	int round = 1,count,i,j,temp;
	char string[20][20];
	char *ptr;

	while(fgets(string[0],100,stdin) != NULL)
	{
		count = 1;
		while(1)
		{
			fgets(string[count++],100,stdin);
			if(string[count - 1][0] == '9')
				break;
		}

		temp = 1;
		for(i = 0;i < count;i++)
			for(j = 0;j < count;j++)
				if(i != j)
				{
					ptr = strstr(string[i],string[j]);
					if(ptr != NULL)
						if(strcmp(string[i],ptr) == 0)
							temp = 0;
				}

		if(temp == 1)
			printf("Set %d is immediately decodable\n",round);
		else
			printf("Set %d is not immediately decodable\n",round);
		round++;
	}
}
@END_OF_SOURCE_CODE
