//include
//------------------------------------------
#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 <complex>
#include <regex>

using namespace std;

#define C_MAX(a, b) ((a)>(b)?(a):(b))
#define SHOW_VECTOR(v) {std::cerr << #v << "\t:";for(const auto& xxx : v){std::cerr << xxx << " ";}std::cerr << "\n";}
#define SHOW_MAP(v) {std::cerr << #v << endl; for(const auto& xxx: v){std::cerr << xxx.first << " " << xxx.second << "\n";}}

vector<string> getColon(string str) {
    vector<string> ret;

    string s = "a";
    bool read = false;

    for (int i = 0; i < str.size(); i++) {
        if (read) {
            if (str[i] == '"') {
                ret.push_back(s);
                s = "a";
                read = false;
            } else {
                s += str[i];
            }
        } else {
            if (str[i] == '"') read = true;
        }
    }
    return ret;
}

vector<string> getNotColon(string str) {
    vector<string> res;
    string s = "";
    bool read = true;
    for (int i = 0; i < str.size(); i++) {
        if (read) {
            if (str[i] == '"') {
                if (!s.empty())
                    res.push_back(s);
                s = "";
                read = false;
            } else {
                s += str[i];
            }
        } else {
            if (str[i] == '"') read = true;
        }
    }
    if (!s.empty()) res.push_back(s);
    return res;
}

int main() {

    while (true) {

        string s1, s2;
        cin >> s1;

        if (s1.size() == 1 && s1[0] == '.') break;
        cin >> s2;

        auto colon1 = getColon(s1);
        auto colon2 = getColon(s2);
        auto notColon1 = getNotColon(s1);
        auto notColon2 = getNotColon(s2);
        

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

        {
            int count = 0;
            if (max(colon1.size(), colon2.size()) - min(colon1.size(), colon2.size()) >= 1) {
                cout << "DIFFERENT"<< endl;
                continue;
            }
            for (int i = 0; i < colon1.size(); i++) {
                if (colon1[i] != colon2[i]) count++;
            }
            if (count > 1) {
                cout << "DIFFERENT"<< endl;
                continue;
            }
            if (count == 1) {
                cout << "CLOSE"<< endl;
                continue;
            }
        }

        cout << "IDENTICAL"<< endl;
    }


    return 0;
}














































Measured memory_bytes: 3100