#include<vector>
#include<list>
#include<map>
#include<climits>
#include<set>
#include<deque>
#include<stack>
#include<bitset>
#include<algorithm>
#include<functional>
#include<numeric>
#include<utility>
#include<sstream>
#include<iostream>
#include<iomanip>
#include<cstdio>
#include<cmath>
#include<cstdlib>
#include<cctype>
#include<string>
#include<cstring>
#include<ctime>
#include<queue>
#include<random>
#include<cctype>
#include<fstream>




using namespace std;

typedef long long ll;
typedef long long LL;

typedef vector<int> VI;
typedef vector<VI> VVI;

int main() 
{
    //std::ofstream ofs("output.txt"); std::cout.rdbuf(ofs.rdbuf());

    while (true) {
        string s1, s2;
        cin >> s1;

        if (s1.length() == 1 && s1 == ".") {
            break;
        }

        cin >> s2;

        //完全に一致
        if (s1 == s2) {
            cout << "IDENTICAL" << endl;
            continue;
        }

        //""以外をチェック
        {
            vector<string> S1;
            vector<string> S2;

            string tmp = "";
            for (int i = 0; i < s1.size(); i++) {
                if (s1[i] == '"') {
                    while (true) {
                        i++;
                        if (s1[i] == '"') {
                            S1.push_back(tmp);
                            tmp = "";
                            break;
                        }
                    }
                }
                else {
                    tmp += s1[i];
                }
            }
            if (tmp.size() > 0) {
                S1.push_back(tmp);
            }

            tmp = "";
            for (int i = 0; i < s2.size(); i++) {
                if (s2[i] == '"') {
                    while (true) {
                        i++;
                        if (s2[i] == '"') {
                            S2.push_back(tmp);
                            tmp = "";
                            break;
                        }
                    }
                }
                else {
                    tmp += s2[i];
                }
            }
            if (tmp.size() > 0) {
                S2.push_back(tmp);
            }

            if (S1.size() != S2.size()) {
                cout << "DIFFERENT" << endl;
                continue;
            }
            else {
                bool good = true;
                for (int i = 0; i < S1.size(); i++) {
                    if (S1[i] != S2[i]) good = false;
                }
                if (!good) {
                    cout << "DIFFERENT" << endl;
                    continue;
                }
            }

        }

        //""内をチェック
        {
            vector<string> S1;
            vector<string> S2;

            for (int i = 0; i < s1.size(); i++) {
                string str = "";
                if (s1[i] == '"') {
                    while (true) {
                        i++;
                        if (s1[i] == '"') {
                            break;
                        }
                        str += s1[i];
                    }
                }
                S1.push_back(str);
            }
            for (int i = 0; i < s2.size(); i++) {
                string str = "";
                if (s2[i] == '"') {
                    while (true) {
                        i++;
                        if (s2[i] == '"') {
                            break;
                        }
                        str += s2[i];
                    }
                }
                S2.push_back(str);
            }

            if (S1.size() != S2.size()) {
                cout << "DIFFERENT" << endl;
            }
            else {
                int count = 0;
                for (int i = 0; i < S1.size(); i++) {
                    if (S1[i] != S2[i]) count++;
                }

                if (count > 1) {
                    cout << "DIFFERENT" << endl;
                }
                else {
                    cout << "CLOSE" << endl;
                }

            }

        }

    }

}


Measured memory_bytes: 3076