#include <bits/stdc++.h>

using namespace std;

//#define DEBUG
#ifdef DEBUG
#define dump(x) cout << "[*] " #x ": " << x << endl
#define debug(x) x
#else
#define dump(x)
#define debug(x)
#endif

int tbl1[201];
int tbl2[201];

void print_string(string& a, int s, int e) {
    const int m = e - s;
    cout << "[*] ";
    for (int i = 0; i < m; ++i) {
        cout << a[s+i];
    }
    cout << endl;
}

inline bool same(string& a, string& b, int a_s, int a_e, int b_s, int b_e) {
    if (a_e - a_s != b_e - b_s) {
        return false;
    }
    const int m = a_e - a_s;
    for (int i = 0; i < m; ++i) {
        if (a[a_s+i] != b[b_s+i]) {
            return false;
        }
    }
    return true;
}

inline bool d_same(string& a, string& b, int a_s, int a_e, int b_s, int b_e) {
    if (a_e - a_s != b_e - b_s) {
        dump(1);
        return false;
    }
    const int m = a_e - a_s;
    dump(m);
    for (int i = 0; i < m; ++i) {
        if (a[a_s+i] != b[b_s+i]) {
            return false;
        }
    }
    return true;
}

int main() {
    while (true) {
        string a, b;
        cin >> a;
        if (a[0] == '.' && a.size() == 1) {
            break;
        }
        for (int i = 0; i < 201; ++i) {
            tbl1[i] = tbl2[i] = 0;
        }
        cin >> b;

        if (a == b) {
            cout << "IDENTICAL" << endl;
            continue;
        }

        int tmp = 0;
        int cnt = 1;
        for (int i = 0; i < a.size(); ++i) {
            if (a[i] == '"') {
                dump(i);
                tbl1[cnt++] = i;
            }
        }
        tbl1[cnt++] = a.size();
        tmp = cnt;
        cnt = 1;
        for (int i = 0; i < b.size(); ++i) {
            if (b[i] == '"') {
                dump(i);
                tbl2[cnt++] = i;
            }
        }
        tbl2[cnt++] = b.size();
        if (tmp != cnt) {
            cout << "DIFFERENT" << endl;
            dump(1);
            continue;
        }

        int ai = 0, bi = 0;
        cnt = 0;
        bool str_flag = false;
        const bool fa = tbl1[1] == 0 && a[0] == '"';
        const bool fb = tbl2[1] == 0 && b[0] == '"';
        dump(fa);
        dump(fb);
        if (fa && fb) {
            str_flag = true;
        } else if (fa || fb) {
            cout << "DIFFERENT" << endl;
            dump(2);
            continue;
        }

        tmp--;
        bool continue_flag = false;
        for (int i = static_cast<int>(tbl1[0] == tbl1[1]); i < tmp; ++i) {
            dump(str_flag);
            if (!same(a, b, tbl1[i], tbl1[i+1], tbl2[i], tbl2[i+1])) {
                if (str_flag) {
                    cnt++;
                } else {
                    debug(print_string(a, tbl1[i], tbl1[i+1]));
                    debug(print_string(b, tbl2[i], tbl2[i+1]));
                    debug(d_same(a, b, tbl1[i], tbl1[i+1], tbl2[i], tbl2[i+1]));
                    cout << "DIFFERENT" << endl;
                    continue_flag = true;
                    dump(3);
                    break;
                }
            }
            str_flag = !str_flag;
            if (cnt > 1) {
                cout << "DIFFERENT" << endl;
                continue_flag = true;
                dump(4);
                break;
            }
        }
        if (!continue_flag)
            cout << "CLOSE" << endl;
    }
    return 0;
}



Measured memory_bytes: 3188