#include <iostream>
#include <vector>
#include <algorithm>
#include <regex>
using namespace std;

vector<string> split(const string &s, regex delim) {
    vector<string> res;
    sregex_token_iterator itr(s.begin(), s.end(), delim, -1), end;
    for(; itr!=end; itr++){
        /*if(*itr != "")*/ res.push_back(*itr);
    }
    return res;
}

int main(){
    while(1){
        vector<string> a(2);
        cin >> a[0];
        if(a[0]==".") break;
        cin >> a[1];

        vector<vector<string> > b(2);
        for(int i=0; i<2; i++){
            b[i] = split(a[i], regex{R"(")"});
        }
        if(b[0].size() != b[1].size()){
            cout << "DIFFERENT" << endl;
        }else{
            vector<int> dif(2, 0);
            for(int i=0; i<(int)b[0].size(); i++){
                if(b[0][i] != b[1][i]) dif[i%2]++;
            }
            if(dif[0]==0 && dif[1]==0){
                cout << "IDENTICAL" << endl;
            }else if(dif[0]==0 && dif[1]==1){
                cout << "CLOSE" << endl;
            }else{
                cout << "DIFFERENT" << endl;
            }
        }
    }
    return 0;
}

