#include<iostream>
#include<algorithm>
#include<vector>

using namespace std;
int main()
{
  int start,end;
  string s1,s2;
  while(1){
    
    cin>>s1;
    if(s1==".") return 0;
    cin>>s2;
    vector<string> i1(0);
    vector<string> i2(0);
    //s1
    start=0,end=-1;
    for(int i=0;i<s1.size();i++){
      if(s1[i]=='"'){
	end=max(0,i-1);
	if(end-start>0){
	  //cout<<"a:i:"<<i<<" "<<s1.substr(start,end-start+1)<<" "<<endl;
	  i1.push_back(s1.substr(start,end-start+1));
	}else{
	  //cout<<"c:i:"<<i<<endl;
	  i1.push_back("");
	}
	start=i+1; end=-1;
	//cout<<"start:"<<start<<" end:"<<end<<endl;
      }
      if((end==-1)and(i==s1.size()-1)){
	end=i;
	//cout<<"b:i:"<<i<<" "<<s1.substr(start,end-start+1)<<" "<<endl;
	i1.push_back(s1.substr(start,end-start+1));
	start=i+1; end=-1;
      }
    }
    //s2
    start=0,end=-1;
    for(int i=0;i<s2.size();i++){
      if(s2[i]=='"'){
	end=max(0,i-1);
	if(end-start>0){
	  i2.push_back(s2.substr(start,end-start+1));
	}else{
	  i2.push_back("");
	}
	start=i+1; end=-1;
      } 
      if((end==-1)and(i==s2.size()-1)){
	end=i;
	i2.push_back(s2.substr(start,end-start+1));
	start=i+1; end=-1;
      }
    }
    int count=0;
    if(i1.size()!=i2.size()){
      //cout<<"a"<<endl;
      count=2;
    }else{
      for(int i=0;i<i1.size();i++){
	if(i%2){
	  if(i1[i]!=i2[i]){
	    //cout<<"b"<<endl;
	    count++;
	  }
	}else{
	  //cout<<"c"<<endl;
	  if(i1[i]!=i2[i]){
	    count=2;
	    break;
	  }
	}
      }
    }

    if(count==0){
      cout<<"IDENTICAL"<<endl;
    }else if(count==1){
      cout<<"CLOSE"<<endl;
    }else{
      cout<<"DIFFERENT"<<endl;
    }
  }
  return 0;
}

