#include<bits/stdc++.h>

using namespace std;

int main(){

  string s1,s2;
  bool t = false;

  while(1){
	int cnt = 0;
	cin>>s1;

	if(s1==".")
	  break;

	cin>>s2;

	if(s1==s2){
	  cout<<"IDENTICAL"<<endl;
	  continue;
	}

	else{
	  int i=0;
	  int j=0;
	  t = false;
	  
	  while(1){

		if(s1[i]=='\0' &&  s2[j]=='\0')
		  break;
		
		if(s1[i]!=s2[j]){
		  cout<<"DIFFERENT"<<endl;
		  t = true;
		  break;
		}
		
		if(s1[i]=='\"' && s2[j]=='\"'){
		  i++;
		  j++;
		  
		  while(1){
			if(s1[i]=='\"' && s2[j]=='\"')
			  break;
			
			if(s1[i]!=s2[j]){
			  cnt++;
			  while(s1[i]!='\"')
				i++;
			  while(s2[j]!='\"')
				j++;
			  break;
			}
			i++;
			j++;
		  } 
		}
		  i++;
		  j++;
	  }
	  if(t == true)
		continue;
	}
	if(cnt == 1)
	  cout<<"CLOSE"<<endl;
	else
	  cout<<"DIFFERENT"<<endl;
  }
}

