#include <bits/stdc++.h>
using namespace std;
int main(void){
    string s;
    while (cin>>s) {
        if (s==".") {
            break;
        }
        int flag=0;
        string tmp="";
        string other="";
        std::deque<string> S;
        std::deque<string> other_S;
        for (int i=0;i<s.size();i++) {
            if (flag==0) {
                if (s[i]=='"') {
                    flag=1;
                    other_S.emplace_back(other);
                    other="";
                } else {
                    other+=s[i];
                    if (i==s.size()-1) {
                        other_S.emplace_back(other);
                    }
                }
            } else {
                if (s[i]=='"') {
                    flag=0;
                    S.emplace_back(tmp);
                    tmp="";
                } else {
                    tmp+=s[i];
                }
            }
        }
        string t;
        cin>>t;
        tmp="";
        other="";
        flag=0;
        std::deque<string> T;
        std::deque<string> other_T;
        for (int i=0;i<t.size();i++) {
            if (flag==0) {
                if (t[i]=='"') {
                    flag=1;
                    other_T.emplace_back(other);
                    other="";
                } else {
                    other+=t[i];
                    if (i==t.size()-1) {
                        other_T.emplace_back(other);
                    }
                }
            } else {
                if (t[i]=='"') {
                    flag=0;
                    T.emplace_back(tmp);
                    tmp="";
                } else {
                    tmp+=t[i];
                }
            }
        }
        /*
        for (auto x:S) {
            cout<<x<<endl;
        }
        cout<<endl;
        for (auto xx:T) {
            cout<<xx<<endl;
        }
        cout<<endl;
        for (auto xxx:other_S) {
            cout<<xxx<<endl;
        }
        cout<<endl;
        for (auto xxxx:other_T) {
            cout<<xxxx<<endl;
        }
        cout<<endl;*/
        if (S.size()!=T.size()||other_S.size()!=other_T.size()) {
            cout<<"DIFFERENT"<<endl;
        } else {
            flag=0; //identical
            if (S.size()!=0&&T.size()!=0) {
                for (int i=0;i<S.size();i++) {
                    if (flag==0) {
                        if (S[i]!=T[i]) {
                            flag=1; //close
                        }
                    } else {
                        if (S[i]!=T[i]) {
                            flag=2; //different
                        }
                    }
                }
            }
            if (other_S.size()!=0&&other_T.size()!=0) {
                for (int i=0;i<other_S.size();i++) {
                    if (other_S[i]!=other_T[i]) {
                        flag=2;
                    }
                }
                if (flag==0) {
                    cout<<"IDENTICAL"<<endl;
                } else if (flag==1) {
                    cout<<"CLOSE"<<endl;
                } else {
                    cout<<"DIFFERENT"<<endl;
                }
            } else {
                if (flag==0) {
                    cout<<"IDENTICAL"<<endl;
                } else if (flag==1) {
                    cout<<"CLOSE"<<endl;
                } else {
                    cout<<"DIFFERENT"<<endl;
                }
            }
        }
    }
}


Measured memory_bytes: 3100