#include <stdio.h>
#include <string.h>

int main()
{
	char *input_str1, *input_str2;
	char *seq1, *seq2;
	int counter_i;
	
	for( ; ; )
	{
		seq1 = '\0';
		seq2 = '\0';
		
		scanf("%s", input_str1);
		if(input_str1[0] == '.')
			break;
		
		scanf("%s", input_str2);
		
		if(strcmp(input_str1, input_str2) == 0)
		{
			printf("IDENTICAL\n");
			continue;
		}
		
		for( ; ; )
		{
			for(counter_i = 0 ; input_str1[counter_i] != '\"' ; counter_i++)
				sprintf(seq1, "%s%c", seq1, input_str1[counter_i]);
				
			for(counter_i = 0 ; input_str2[counter_i] != '\"' ; counter_i++)
				sprintf(seq2, "%s%c", seq2, input_str2[counter_i]);
			
			if(strcmp(seq1, seq2) != 0)
			{
				printf("DIFFERENT\n");
				continue;
			}
		}

	}
	
	return 0;
}
