#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
template <typename T> using V = vector<T>;

using VS = vector<string>;

pair<VS, VS> parse(const string &S) {
    VS num, str;
    bool in_quot = false;
    bool init = true;
    string now = "";
    for(char c : S) {
        if(c == ';' && !in_quot) {
            num.push_back(move(now));
            now = "";
            continue;
        }
        if(c == '"') {
            if(!init) {
                auto &se = (in_quot ? str : num);
                se.push_back(move(now));
                now = "";
            }
            in_quot = !in_quot;
        } else {
            now += c;
        }
        init = false;
    }
    if(now.size()) num.push_back(now);
    return move(make_pair(num, str));
}

ll check(const VS &s, const VS &t) {
    if(s.size() != t.size()) return -1;
    ll cnt = 0;
    for(ll i = 0; i < s.size(); i++) if(s[i] != t[i]) cnt++;
    if(cnt == 0) return 1;
    else if(cnt == 1) return 0;
    else return -1;
}

bool solve() {
    string S;
    cin >> S;
    if(S == ".") return false;
    string T;
    cin >> T;

    VS snum, sstr, tnum, tstr;
    tie(snum, sstr) = parse(S);
    tie(tnum, tstr) = parse(T);

    ll cnum = check(snum, tnum);
    ll cstr = check(sstr, tstr);

    if(cnum == 1 && cstr == 1) cout << "IDENTICAL";
    else if(cnum == 1 && cstr == 0) cout << "CLOSE";
    else cout << "DIFFERENT";
    cout << endl;
    return true;
}

int main() {
    while(solve());
    return 0;
}

