#include<bits/stdc++.h>
using namespace std;

using i64 = int64_t;

int main(){
    string s1;
    while(cin >> s1, s1 != "."){
        string s2;
        cin >> s2;
        if(s1 == s2){
            cout << "IDENTICAL" << endl;
            continue;
        }
        int n1 = 0, n2 = 0;
        for(auto c: s1){
            if(c == '"')n1++;
        }
        for(auto c: s2){
            if(c == '"')n2++;
        }
        if(n1 != n2){
            cout << "DIFFERENT" << endl;
            continue;
        }
        s1 += "\""; s2 += "\"";
        int s1left = 0, s2left = 0, cnt = 0;
        bool quote = false, ok = true;
        while(s1left < s1.size() && s2left < s2.size()){
            int s1right = s1left, s2right = s2left;
            while(s1right < s1.size() && s1[s1right] != '"')s1right++;
            while(s2right < s2.size() && s2[s2right] != '"')s2right++;
            string t1 = s1.substr(s1left, s1right-s1left), t2 = s2.substr(s2left, s2right-s2left);
            //cerr << t1 << " " << t2 << endl;
            if(quote){
                if(t1 != t2)cnt++;
            }else{
                if(t1 != t2){
                    ok = false;
                    break;
                }
            }
            s1left = s1right+1;
            s2left = s2right+1;
            quote ^= 1;
        }
        //cerr << ok << " " << cnt << endl;
        if(!ok || cnt > 1){
            cout << "DIFFERENT" << endl;
        }else{
            cout << "CLOSE" << endl;
        }
    }

    return 0;
}

