#include <iostream>
#include <string>
#include <vector>

using namespace std;

int main() {
    int cnt;
    string s1, s2, tmp;
    vector<string> sv1, sv2;

    while (cin >> s1) {
        if (s1 == ".") { break; }

        cin >> s2;

        sv1.clear(); sv2.clear();
        tmp = ""; cnt = 0;
        if (s1 == s2) { cout << "IDENTICAL" << endl; }
        else {
            for (int i = 0; i < s1.size()+1; i++) {
                if (s1[i] != '"' && i != s1.size()) { tmp += s1[i]; }
                else { sv1.push_back(tmp); tmp = ""; }
            }
            for (int i = 0; i < s2.size()+1; i++) {
                if (s2[i] != '"' && i != s2.size()) { tmp += s2[i]; }
                else { sv2.push_back(tmp); tmp = ""; }
            }
            if (sv1.size() != sv2.size()) { cnt += 2; }
            else {
                for (int i = 0; i < sv1.size(); i++) {
                    if (sv1[i] != sv2[i] && i % 2 == 1) { cnt++; }
                    else if (sv1[i] != sv2[i]) { cnt += 2; break; }
                }
            }
            cout << ((cnt == 1) ? "CLOSE" : "DIFFERENT") << endl;
        }
    }
    return 0;
}
