#include <iostream>
#include <fstream>
#include <stdio.h>
#include <string.h>
#include <vector>

using namespace std;

int main(int argc, const char * argv[]) {
    // insert code here...
    
    
    /////////
    //write//
    /////////
    
    while(1){
        char s1[200]; cin >> s1;
        if(s1[0]=='.')break;
        char s2[200]; cin >> s2;
        vector<int> v;
        
        if(strcmp(s1,s2)==0)cout << "IDENTICAL" << endl;
        else{
            int now_s1 = 0;
            int now_s2 = 0;
            bool different =false;
            bool close = false;
            int close_cnt = 0;
            int s1_ten_cnt = 0;
            int s2_ten_cnt = 0;
            
            //s1,s2が"
            //s1only
            //s2only
            //以外
            
            for(int i=0; s1[i] != '\0'; i++){
                if(s1[i] == '\"'){
                    s1_ten_cnt++;
                }
            }
            for(int i=0; s2[i] != '\0'; i++){
                if(s2[i] == '\"'){
                    s2_ten_cnt++;
                }
            }
            
            for(int i=0; s1[now_s1] != '\0'; i++){
                if(s1_ten_cnt!=s2_ten_cnt){
                    different = true;
                    break;
                }
                if(s2[now_s2] == '\0' ){
                    break;
                }
                
                //close_cnt, different
                if(s1[now_s1] == '\"' && s2[now_s2] == '\"'){
                    while(1){
                        now_s1++;
                        now_s2++;
                        if(s1[now_s1] != s2[now_s2]){
                            close = true;
                        }
                        if(s1[now_s1] == '\"' && s2[now_s2] == '\"'){
                            break;
                        }else if(s1[now_s1] == '\"'){
                            bool tmp = false;
                            while(1){
                                now_s2++;
                                if(s2[now_s2]=='\"' || s2[now_s2]=='\0'){
                                    tmp =true;
                                    break;
                                }
                            }
                            if(tmp)break;
                        }else if(s2[now_s2] == '\"'){
                            bool tmp = false;
                            while(1){
                                now_s1++;
                                if(s1[now_s1]=='\"' || s1[now_s1]=='\0'){
                                    tmp =true;
                                    break;
                                }
                            }
                            if(tmp)break;
                        }
                    }
                    if(close){
                        close = false;
                        close_cnt++;
                    }
                    now_s1++;
                    now_s2++;
                }
                else if(s1[now_s1] == '\"'){
                    different = true;
                    break;
                }
                else if(s2[now_s2] == '\"'){
                    different = true;
                    break;
                }
                else {
                    if(s1[now_s1] != s2[now_s2]){
                        different = true;
                    }
                    now_s1++;
                    now_s2++;
                }
            }
            //output
            
            
            if(different)
                cout << "DIFFERENT" << endl;
            else
                if(close_cnt<=1){
                    cout << "CLOSE" << endl;
                }
                else{
                    cout << "DIFFERENT" << endl;
                }
        }//else
    }//while
    
    return 0;
}



Measured memory_bytes: 3104