#include<stdio.h>
int main(void) {
	char s1[300], s2[300];
	int i = 0, cnt, jud,j;
	while (1) {
		cnt = 0;
		jud = 0;
		i = 0;
		j=0;
		//fgets(s1,sizeof(s1),stdin);
		scanf("%s",s1);
		if (s1[0] == '.') {
			break;
		}
		//fgets(s2,sizeof(s2),stdin);
		scanf("%s",s2);
		while (s1[i] != '\n') {
			if ((s1[i] != s2[j]) && (jud == 0)) {
				cnt++;
				jud = 1;
			}
			if (s1[i] == ';') {
			    if(s2[j]!='s'){
			        do{
			            j++;
			        }while(s2[j]!=';');
			    }
				jud = 0;
			}else if(s2[j]==';'){
			    do{
			        i++;
			    }while(s1[i]!=';');
			    jud=0;
			}
			i++;
			j++;
		}
		if (cnt == 0) {
			printf("IDENTICAL\n");
		}
		else if (cnt == 1) {
			printf("CLOSE\n");
		}
		else {
			printf("DIFFERENT\n");
		}
	}
	return 0;
}
