#include <bits/stdc++.h>
using namespace std;
char s1[305], s2[305];
int len1, len2, tp1, tp2;
int main(){
    while(1){
       // puts("INN");
        scanf("%s",s1);
        if(s1[0]=='.')break;
        scanf("%s",s2);
        len1 = strlen(s1);
        len2 = strlen(s2);
        if(len1 == len2){
            for(int i = 0 ;i < len1 ;i++){
                if(s1[i] != s2[i]) goto BYY;
            }
        }else{
            goto BYY;
        }
        puts("IDENTICAL");
        continue;
        BYY:;
        tp1 = tp2 = 0;
        int gg = 0;
        while(tp1 != len1 || tp2 != len2){
//            printf("qwq %d %d\n",tp1,tp2);
            if(s1[tp1] != s2[tp2]){
                puts("DIFFERENT");
                goto BYEE;
            }
            if(s1[tp1] == '"' && s2[tp2]=='"'){
                int t1,t2;
                for(t1 = tp1+1;s1[t1]!= '"' ;t1++ ) ;
                for(t2 = tp2+1;s2[t2]!= '"' ;t2++ ) ;
                bool flag = false;
                if(t1-tp1 == t2-tp2){
                    for(int i = tp1 ; i <= t1 ; i++){
                        if(s1[tp1++]!=s2[tp2++]){
                            flag = true;
                            break;
                        }
                    }
                }else{
                    flag = true;
                }
                if(flag)gg++;
                tp1 = t1+1;
                tp2 = t2+1;
                if(gg>1){
                    puts("DIFFERENT");
                    goto BYEE;
                }
            }else{
                tp1++,tp2++;
            }


        }
        if(gg==1)puts("CLOSE");
        BYEE:;

    }
}