#include<iostream>
#include<cstdio>
#include<cstring>
#include<string.h>
using namespace std;

char s1[205],s2[205];
bool mark;
int w,ww,i,j;
int main()
{
	while(1)
	{
		w=0;
		mark=0;
		scanf("%s",s1);
		if(s1[0]=='.') break;
		scanf("%s",s2);
		int l=strlen(s1),len=strlen(s2);
		for(i=0,j=0;i<l&&j<len;j++,i++)
		{
			//printf("%d %c %d %c %d\n",i,s1[i],j,s2[j],mark);
			if(s1[i]==s2[j]&&s1[i]!='"') continue;
			if(s1[i]=='"'&&s2[j]=='"') 
			{
				mark=(mark+1)%2;
			}
			if(s1[i]!=s2[j]&&!(mark)) 
			{
				printf("DIFFERENT\n");
				w=2;
				break;
			} 
			if(s1[i]!=s2[j]&&mark)
			{
				w++;
				if(w>1)
				{
					printf("DIFFERENT\n");
					break;	
				}
				else 
				{
					while(s1[i]!='"') i++;
					while(s2[j]!='"') j++;
					mark=0;
				}
			}
		} 
		if(w!=2&&(len-j>0||l-i>0))
		{
			printf("DIFFERENT\n");
			w=2;
		} 
		else if(w==1) printf("CLOSE\n");
			if(w==0) printf("IDENTICAL\n");
	}
	return 0;
}
