#include<iostream>
#include<vector>
#include<string>
using namespace std;

int main(){
    string s,t;
    while(cin >> s&&s!="."){
        cin >> t;
        vector<string> v1,u1,v2,u2;
        bool flag = 0;
        string tmp;
        for(int i=0;i<s.size();i++){
            if(s[i]=='"'&&!flag){
                v1.push_back(tmp);
                flag = 1;
                tmp.clear();
            }else if(s[i]=='"'&&flag){
                u1.push_back(tmp);
                flag = 0;
                tmp.clear();
            }else{
                tmp.push_back(s[i]);
            }
        }
        v1.push_back(tmp);
        string tmp2;
        flag = 0;
        for(int i=0;i<t.size();i++){
            if(t[i]=='"'&&!flag){
                v2.push_back(tmp2);
                flag = 1;
                tmp2.clear();
            }else if(t[i]=='"'&&flag){
                u2.push_back(tmp2);
                flag = 0;
                tmp2.clear();
            }else{
                tmp2.push_back(t[i]);
            }
        }
        v2.push_back(tmp2);
        
        if(v1.size()!=v2.size()||u1.size()!=u2.size()){
            cout << "DIFFERENT" << endl;
            continue;
        }
        flag =0;
        for(int i=0;i<v1.size();i++){
            if(v1[i]!=v2[i]){
                cout <<"DIFFERENT" << endl;
                flag = 1;
                break;
            }
        }
        if(flag)continue;
        int cnt = 0;
        for(int i=0;i<u1.size();i++){
            if(u1[i]!=u2[i]){
                cnt++;
            }
        }
        if(cnt==0){
            cout << "IDENTICAL" << endl;
        }else if(cnt==1){
            cout << "CLOSE" << endl;
        }else{
            cout << "DIFFERENT" << endl;
        }

        
    }
    return 0;
}
