#include<bits/stdc++.h>
using namespace std;
//type
typedef long long ll;
using pii = pair<int, int>;
using vi = vector<int>;
//x * y * 1.0 can cause overflow
//constant
#define inf (int)(1e9+7)
#define mod (ll)(1e9+7)
#define eps 1e-10
//int dy[] = {0, 0, -1, 1, -1, 1, -1, 1}; //右、左、マイナス、プラス
//int dx[] = {1, -1, 0, 0, -1, 1, 1, -1};
//omission
#define eb emplace_back
#define F first
#define S second
#define SZ(x) ((int)(x).size())
#define all(v) v.begin(), v.end()
//manip
template<class T> bool chmax(T &a, T &b) {if (a < b) {a = b; return 1;} return 0;}
#define chmin(a, b) a = min(a, b)
#define UNIQUE(v) v.erase(unique(v.begin(), v.end(), v.end());
#define ceil(a, b) a / b + !!(a % b)
template<class T> T power(T a, T b)
{return b ? power(a * a % inf, b / 2) * (b % 2 ? a : 1) % inf : 1;}
#define LB(v, x) (int)(lower_bound(v.begin(), v.end(), x) - v.begin())
#define UB(v, x) (int)(upper_bound(v.begin(), v.end(), x) - v.begin())
//loop
#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define rep3(i, st, n) for (int i = st; i < n; ++i)
//algorithm
//double pointer, l start, how many adds, can be 0 -> init r = l, sum = 0
//bfs, not x, y, i, j
//not !(i % 2), i % 2 == 0






int main() {
    //cast caution
    //look constraints always
    cin.tie(0); ios::sync_with_stdio(false);
    
    
    
    
    
    
    string s;
    while (cin >> s && s != ".") {
        string t; cin >> t;
        
        // " の数
        int cnt = 0;
        rep(i, SZ(s)) if (s[i] == '"') cnt++;
        int cnt2 = 0;
        rep(i, SZ(t)) if (t[i] == '"') cnt2++;
        if (cnt != cnt2) {
            cout << "DIFFERENT" << endl;
            continue;
        }
        
        
        
        
        
        
        vector<string> ss;
        int flg = 0;
        string tmp;
        rep(i, SZ(s)) {
            if (flg == 0) {
                if (s[i] == '"') {ss.eb(tmp); tmp = ""; flg = 1; continue;}
                tmp += s[i];
                
            } else {
                if (s[i] == '"') {flg = 0; continue;}
                
            }
        }
        if (tmp != "") {
            ss.eb(tmp);
        }
        tmp = "";
        /*
        rep(i, SZ(ss)) {
            cout << ss[i] << endl;
        }
        */
        
        flg = 0;
        vector<string> tt;
        rep(i, SZ(t)) {
            if (flg == 0) {
                if (t[i] == '"') {tt.eb(tmp); tmp = ""; flg = 1; continue;}
                tmp += t[i];
                
            } else {
                if (t[i] == '"') {flg = 0; continue;}
                
            }
        }
        if (tmp != "") {
            tt.eb(tmp);
        }
        tmp = "";
        /*
        rep(i, SZ(tt)) {
            cout << tt[i] << endl;
        }
        */
        
        
        
        if (SZ(ss) != SZ(tt)) {
            cout << "DIFFERENT" << endl;
            continue;
        }
        flg = 0;
        rep(i, SZ(ss)) {
            if (ss[i] != tt[i]) {
                cout << "DIFFERENT" << endl;
                flg = 1;
                break;
            }
            
        }
        if (flg) continue;
        ss.clear();
        tt.clear();
        
        flg = 0;
        rep(i, SZ(s)) {
            if (flg == 1) {
                if (s[i] == '"') {ss.eb(tmp); tmp = ""; flg = 0; continue;}
                tmp += s[i];
                
            } else {
                if (s[i] == '"') {flg = 1; continue;}
                
            }
        }
        
        
        if (tmp != "") {
            ss.eb(tmp);
        }
        tmp = "";
        /*
         rep(i, SZ(ss)) {
         cout << ss[i] << endl;
         }
        */
        
        flg = 0;
        
        rep(i, SZ(t)) {
            if (flg == 1) {
                if (t[i] == '"') {tt.eb(tmp); tmp = ""; flg = 0; continue;}
                tmp += t[i];
                
            } else {
                if (t[i] == '"') {flg = 1; continue;}
                
            }
        }
        if (tmp != "") {
            tt.eb(tmp);
        }
        tmp = "";
        /*
         rep(i, SZ(tt)) {
         cout << tt[i] << endl;
         }
        */
        
        
        cnt = 0;
        
        rep(i, SZ(ss)) {
            if (ss[i] != tt[i]) cnt++;
        }
        if (cnt >= 2) {
            cout << "DIFFERENT" << endl;
        } else if (cnt == 1) {
            cout << "CLOSE" << endl;
        } else {
            cout << "IDENTICAL" << endl;
            
        }
    }
        
}
//cast caution





Measured memory_bytes: 3156