#include<iostream>

using namespace std;

int main(){

  char s1[200]={0};
  char s2[200]={0};
  char t1[200]={0};
  char t2[200]={0};
  char u1[200]={0};
  char u2[200]={0};

  int c=0,flag=0,j=0,k=0,l=0;

  for(int x=0;x<100;x++){


  cin>>s1;
  if(s1[0]=='.') break;               //input
  cin>>s2;


  for(int i=0;i<200;i++){           
    if(s1[i]=='"'){
      if(flag==0){
	flag=1;
	
      }else if(flag==1){
	flag=0;
	
      }
    }

    if(flag==1){                   //copy to u
      t1[j]=s1[i];
      j++;    
    }

    if(flag==0){                 //copy to t
      u1[l]=s1[i];
      l++;    
    }


  }
  j=0;
  l=0;
  flag=0;

  for(int i=0;i<200;i++){             

    if(s2[i]=='"'){
      if(flag==0){
	flag=1;
	
      }else if(flag==1){
	flag=0;
	
      }
    }

    if(flag==1){                       //copy to t

      t2[j]=s2[i];
      j++;
    }

 if(flag==0){                            //copy to u
      u2[l]=s2[i];
      l++;
    }

  }
 j=0;
 l=0;
 flag=0;

 
   
 for(int i=0;i<150;i++){           //check in " "


    if(flag==1){
    if(t1[j]!=t2[k]){
      c++;
      flag=0;
    }

    if(t1[j]=='"' && t2[k]!='"'){
      j--;
    }
    if(t2[k]=='"' && t1[j]!='"'){
      k--;
    }

    j++;
    k++;

    }

   if(t1[j]=='"' && t2[k]=='"'){
     flag=1;

    }


  }

    j=0;
    k=0;
    l=0;
    flag=0;


 for(int i=0;i<200;i++){               //check out " "
    if(u1[i]!=u2[i]){
      c=2;
    }
  }

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

    c=0;

   
    /*   cout<<t1<<endl;
    cout<<t2<<endl;
    cout<<u1<<endl;
    cout<<u2<<endl;*/
    for(int i=0;i<200;i++){
     s1[i]=0;
    s2[i]=0;
    t1[i]=0;
    t2[i]=0;
    u1[i]=0;
    u2[i]=0;
    }

  }

  return 0;
}

