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

void main()
{
	int i,j,k;
	char s1[200]={'\0'},s2[200]={'\0'},buf[200]={'\0'};
	int l1,l2,l;
	int maxDataset,c,flag;
	int f1, f2;
	/*
	for(i=0;i<200;i++){
		s1[i] = '\0';
		s2[i] = '\0';
		buf[i] = '\0';
	}
	*/
	for( maxDataset=0; maxDataset < 100; maxDataset++){
		flag = c = 0;
		scanf("%s",s1);
		if( strcmp(s1,".") == 0 ) break;
		scanf("%s",s2);
		l1 = strlen(s1);
		l2 = strlen(s2);
		l = l1;
		if( l1 > l2 ){
			l = l2;
			strcpy( buf, s1 );
			strcpy( s1 , s2 );
			strcpy( s2 , buf);
		}
		for( i = 0, j = 0; i < l1 && j < l2 ; i++, j++){
			if( s1[i] != s2[j] ){
				if( flag == 1 ){
					f1 = f2 = 0;
					c++;
					for(k=0;k<l;k++){
						if( s1[i] == '"' ){
							flag = 0;
							f1 = 1;
							if( f1==1 && f2==1 ) break;
						}else{
							i++;
						}
						if( s2[j] == '"'){
							f1 = 1;
							if( f1 == 1 && f2==1 ) break;
						}else{
							j++;
						}
					}
				}else{ c = 2; break; }
			}else if( s1[i] == '"' ){
				flag = (flag+1) % 2;
			}
		};
		if( c == 0 && s2[j] == '\0' ) printf("IDENTICAL\n");
		else if( c == 1 ) printf("CLOSE\n");
		else printf("DIFFERENT\n");
	}
	return;
}
							
			
