#include<stdio.h>
char s1[10001],s2[10001],i,f,f1,f2;
int main()
{
     scanf("%s",s1);
     while(s1[0]!='.')
     {
          scanf("%s",s2);
          f=0;
          f1=0;
          f2=0;
          i=0;
          while((f1==0)||(f2==0))
          {
             if(s1[i]=='\0')
                f1=1;
             if(s2[i]=='\0')
                f2=1;
             if((f1==0)&&(f2==0))
              if(s1[i]!=s2[i])
              {
                  f=f+1;
                  //printf("%d ",i);
              }

            if((!((f1==1)&&(f2==1)))&&((f1==1)||(f2==1)))
            {
                f=f+1;
                //printf("%d %d",f1,f2);
            }

              if(f>1)
                break;
              i=i+1;
          }


          if(f==0)
             printf("IDENTICAL\n");
          if(f==1)
             printf("CLOSE\n");
          if(f>1)
             printf("DIFFERENT\n");
          scanf("%s",s1);
     }
     return 0;
}

