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

void main()
{
	char s1[200];
	char s2[200];
	int cnt,i,j;
	int l, l1,l2;
	int k, flag;
	int c1,c2,cnn;
	while(1){
		cnt = 0;
		c1 = 201;
		c2 = 201;
		flag = 0;
		for(i=0;i<200;i++){
			s1[i] = '\0';
			s2[i] = '\0';
		}
		scanf("%s",s1);
		if(strcmp(s1,".") == 0) break; 
		scanf("%s",s2);
		l1 = strlen(s1);
		l2 = strlen(s2);
		if(l1 >= l2){ l = l1 ;}
		else{ l = l2; }
		for(i=0,j=0;i<l;i++,j++){
			if(s1[i] != s2[j]){
				if( flag == 1 && (i-1) != c2 && (j-1) != c2 ){
					cnt++;
					cnn = 0;
					for( k=0; k < l; k++ ){
						if(s1[i] == '"'){
							flag = 0;
							c1=i;
							cnn++;
							if( cnn == 2 ) break;
						}else{
							i++;
						}
						if(s2[j] == '"'){
							flag = 0;
							c2 = j;
							cnn++;
							if(cnn == 2) break;
						}else{
							j++;
						}
					}
				}else{
					cnt = 2;
					break;
				}
			}else if(s1[i] == '"'){
				flag = (flag + 1) % 2;
				if( flag == 0 ){
					c1 = i;
					c2 = j;
			}
			}
		}
		if(cnt == 0){ printf("IDENTICAL\n"); }
		if(cnt == 1){ printf("CLOSE\n"); }
		if(cnt == 2){ printf("DIFFERENT\n"); }
	}
}
