#include <bits/stdc++.h>
#define rep(i, a, b) for(ll i = ll(a); i < ll(b); i++)
#define rer(i, a, b) for(ll i = ll(a) - 1; i >= ll(b); i--)
#define sz(v) (int)(v).size()
#define pb push_back
#define sc second
#define fr first
#define sor(v) sort(v.begin(),v.end())
#define rev(s) reverse(s.begin(),s.end())
#define lb(vec,a) lower_bound(vec.begin(),vec.end(),a)
#define ub(vec,a) upper_bound(vec.begin(),vec.end(),a)
#define uniq(vec) vec.erase(unique(vec.begin(),vec.end()),vec.end())
using namespace std;
typedef long long int ll;
typedef pair <int, int> P;

const ll MOD=1000000007;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    for(;;){
        string s, t;
        cin>>s;
        if(s==".") return 0;
        cin>>t;
        int cnt=0;
        int cur=0;
        int i=0, j=0;
        while(i<s.length()&&j<t.length()){
            if(!cur){
                if(s[i]!=t[j]) break;
                else {
                    if(s[i]=='"'&&t[j]=='"'){
                        cur=1;
                    }
                    i++; j++;
                }
            }
            else{
                int x=i, y=j;
                while(s[x]!='"'){
                    x++;
                }
                while(t[y]!='"'){
                    y++;
                }
                if(s.substr(i,x-i)!=t.substr(j,y-j)) cnt++;
                i=x+1;
                j=y+1;
                cur=0;
            }
        }
        if(i==s.length()&&j==t.length()){
            if(cnt==0) cout <<"IDENTICAL"<<"\n";
            else if(cnt==1) cout <<"CLOSE"<<"\n";
            else cout <<"DIFFERENT"<<"\n";
        }
        else cout <<"DIFFERENT"<<"\n";
    }
}
