#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#define LEN 201
#define max(x,y) (x) < (y)?(y):(x)
char s[LEN], t[LEN];
int first,second;
int len1, len2;
int right(int left, char text[]){
    int r=left;
    char c;
    while(1){
        c=text[++r];
        if(c=='\"') break;
    }
    return r;
}
int search(void){
    int count=0;
    while(1){
        //printf("first=%d second=%d\n",first,second);
        if(first==len1-1 && second==len2-1) return 1;
        if(s[first]!=t[second]) return 0;
        else{
            if(s[first]=='\"'){
                int r1=right(first,s),r2=right(second,t);
                int n=max(r1-first,r2-second);
                for(int i=1;i<n;i++){
                    if(s[++first]!=t[++second]){
                        count++; break;
                    }
                }
                if(count == 2) return 0;
                if(r1==len1-1 && r2==len2-1) return 1;
                first=r1+1; second=r2+1;
            }
            else{
                first++; second++;
            }
        }
        if(first==len1-1 && second==len2-1) return 1;
    }
}
int main(void){
    while(1){
        first=second=0;
        scanf("%s",s);
        if(strcmp(s,".")==0) break;
        scanf("%s",t);
        len1=strlen(s); len2=strlen(t);
        int flag=1;
        //printf("%s\n%s\n",s,t);
        int n=max(len1,len2);
        for(int i=0; i<n; i++){
            if(s[i]!=t[i]) {flag=0; break;}
        }
        if(flag==1) printf("IDENTICAL\n");
        else{
            if(search()==0) printf("DIFFERENT\n");
            else printf("CLOSE\n");
        }
    }
    return 0;
}

