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

int main() {

    while(1){

        string s1,s2;

        cin >> s1;

        if(s1[0] == '.' && s1.size() == 1){
            break;
        }

        cin >> s2;

        string::iterator itr1 = s1.begin(),itr2 = s2.begin();

        bool firstdiff = false;

        bool is_into_quotation = false;

        string ans = "INCOLLECT";

        while(1){

            if(*itr1 == '"' && *itr2 == '"'){
                if(is_into_quotation){
                    is_into_quotation = false;
                }
                else{
                    is_into_quotation = true;
                }
            }

            if(*itr1 != *itr2){
                if(is_into_quotation && !firstdiff){

                    while(*itr1 != '"'){
                        itr1++;
                    }

                    while(*itr2 != '"'){
                        itr2++;
                    }

                    is_into_quotation = false;


                    firstdiff = true;
                }
                else{
                    ans = "DIFFERENT";
                    break;
                }
            }

            itr1++; itr2++;

            if(itr1 == s1.end() && itr2 == s2.end()){
                if(firstdiff){
                    ans = "CLOSE";
                }
                else{
                    ans = "IDENTICAL";
                }
                break;
            }

        }

        cout << ans << endl;

    }

    return 0;
}