#include <stdio.h>
#include <string.h>
#define ll long long
#define rep(i,l,r)for(ll i=l;i<r;i++)

char s1[300],s2[300];
int main(){
	while(scanf(" %s %s",s1,s2),*s1!='.'){
		int s1cnt=1,s2cnt=1;
		char*p=s1;
		while(p=strchr(p,'\"')){
			*p=0;
			s1cnt++;
			p++;
		}
		char*q=s2;
		while(q=strchr(q,'\"')){
			*q=0;
			s2cnt++;
			q++;
		}
		if(s1cnt!=s2cnt){
			puts("DIFFERENT");
		}else{
			int cnt=0;
			p=s1;
			q=s2;
			rep(i,0,s1cnt){
				if(strcmp(p,q))cnt+=i%2?1:2;
				p+=strlen(p)+1;
				q+=strlen(q)+1;
			}
			puts(cnt>=2?"DIFFERENT":cnt==1?"CLOSE":"IDENTICAL");
		}
	}
}
