#include <cstdio>
#define MAX_L 200

char s1[MAX_L+1],s2[MAX_L+1];

void solve(){
	int flag=0;
	while(1){
		scanf("%s",s1);
		if(s1[0]=='.')return;
		scanf("%s",s2);
		char *f=s1,*s=s2;
		while(1){
			if(*f==*s){
				if(*f=='\0'){
					if(flag==1)printf("CLOSE\n");
					else if(flag>1)printf("DIFFERENT\n");
					else printf("IDENTICAL\n");
					flag=0;
					break;
				}
				if(*f=='\"'){
					f++;s++;
					while(1){
						if(*f==*s){
							if(*f=='\0')
								break;
							else if(*f=='\"'){
								f++;s++;
								break;
							}
						}else{
							flag++;
							while(*f!='\"')f++;
							while(*s!='\"')s++;
							f++;s++;
							break;
						}
						f++;s++;
					}
				}else{
					f++;s++;
				}
			}else{
				printf("DIFFERENT\n");
				break;
			}
		}

	}
}

int main(){
	solve();
	return 0;
}
