#include <iostream>
#include <bitset>
#include <fstream>
#include <string>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <vector>
#include <algorithm>
#include <numeric>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <functional>
#include <cctype>
#include <list>
#include <limits>
#include <unordered_map>
#include <cassert>
//#include <boost/multiprecision/cpp_int.hpp>

const double EPS = (1e-10);


using namespace std;
using Int = long long;
//using namespace boost::multiprecision;

const Int MOD = 998244353;

Int mod_pow(Int x, Int n) {
    Int res = 1;
    while(n > 0) {
        if(n & 1) res = (res * x) % MOD; //ビット演算(最下位ビットが1のとき)
        x = (x * x) % MOD;
        n >>= 1; //右シフト(n = n >> 1)
    }
    return res;
}

//最大公約数
template<typename T>
T gcd(T a, T b) {
    return b != 0 ? gcd(b, a % b) : a;
}

//最小公倍数
template<typename T>
T lcm(T a, T b) {
    return a * b / gcd(a, b);
}

//入出力高速化(非同期化)
void fast_input() {
    cin.tie(0);
    ios::sync_with_stdio(false);
}

int solve(string &s1, string &s2) {
    vector<string> s1str;
    vector<string> s2str;
    vector<string> parsed_s1;
    vector<string> parsed_s2;
    if (s1.length() == s2.length()) {
        for (size_t i = 0; i < s1.length(); i++) {
            if (s1[i] != s2[i]) {
                break;
            }
            if (i == s1.length() -1) {
                return 0;
            }
        }
    }
    string tmp;
    int flag = 0;
    for (size_t i = 0; i < s1.length(); i++) {
        if (s1[i] == '"'){ 
            flag ^= 1;
            if (!flag) {
                if (tmp.length()) s1str.push_back(tmp);
                else s1str.push_back("-1");
                tmp.clear();
            }
            continue;
        }
        if (flag) {
            tmp.push_back(s1[i]);
        }
    }
    s1.push_back('"');
    flag = 1;
    for (size_t i = 0; i < s1.length(); i++) {
        if (s1[i] == '"'){ 
            flag ^= 1;
            if (!flag) {
                if (tmp.length()) parsed_s1.push_back(tmp);
                else parsed_s1.push_back("-1");
                tmp.clear();
            }
            continue;
        }
        if (flag) {
            tmp.push_back(s1[i]);
        }
    }
    flag = 0;
    for (size_t i = 0; i < s2.length(); i++) {
        if (s2[i] == '"'){ 
            flag ^= 1;
            if (!flag) {
                if (tmp.length()) s2str.push_back(tmp);
                else s2str.push_back("-1");
                tmp.clear();
            }
            continue;
        }
        if (flag) {
            tmp.push_back(s2[i]);
        }
    }
    s2.push_back('"');
    flag = 1;
    for (size_t i = 0; i < s2.length(); i++) {
        if (s2[i] == '"'){ 
            flag ^= 1;
            if (!flag) {
                if (tmp.length()) parsed_s2.push_back(tmp);
                else parsed_s2.push_back("-1");
                tmp.clear();
            }
            continue;
        }
        if (flag) {
            tmp.push_back(s2[i]);
        }
    }
    

    int cnt = 0;
    if (s1str.size() == s2str.size()) {
        for (size_t i = 0; i < s1str.size(); i++) {
            if (s1str[i] != s2str[i]) {
                cnt++;
            }
        }
        if (parsed_s1.size() == parsed_s2.size()) {
            for (size_t i = 0; i < parsed_s1.size(); i++) {
                if (parsed_s1[i] != parsed_s2[i]) {
                    cnt = 100;
                }
            }
        }
        if (cnt < 2) return 1; 
    }
    return 2;
}

int main(void) {
    string s1, s2;

    vector<int> ans;
    while (1) {
        cin >> s1;
        if (s1[0] != '.') cin >> s2;
        else break;
        ans.push_back(solve(s1, s2));
    }
    vector<string> ansString = {"IDENTICAL", "CLOSE", "DIFFERENT"};
    for (auto i : ans) {
        cout << ansString[i] << endl;
    }
}   





Measured memory_bytes: 3156