#include <bits/stdc++.h>
using namespace std;
const long double PI = acos(-1);
typedef long long ll;
typedef pair<int64_t,int64_t> pll;
int dx[]={1,-1,0,0,1,-1,1,-1};
int dy[]={0,0,1,-1,1,-1,-1,1};
#define rep(i,a,b) for (int64_t i = (a); i < (b); i++)
#define REP(i,n) rep(i,0,n)
#define ALL(a) begin(a),end(a)
#define sz(s) (s).size()
#define pb push_back
//#define mp make_pair
#define fi first
#define se second

int main()
{
    string s1;string s2;
    while(getline(cin,s1))
    {
        if(s1==".")break;getline(cin,s2);
        if(s1==s2){cout<<"IDENTICAL"<<endl;continue;}
        bool flag=0;
        vector<int>c1(0);vector<int>c2(0);c1.pb(0);c2.pb(0);
        REP(i,s1.size())if(s1[i]=='\"')c1.pb(i);
        REP(i,s2.size())if(s2[i]=='\"')c2.pb(i);
        c1.pb(s1.size()-1);c2.pb(s2.size()-1);
        if(c1.size()!=c2.size()){cout<<"DIFFERENT"<<endl;continue;}
        int times=0;
        REP(i,c1.size()-1)
        {
            string t1=s1.substr(c1[i],c1[i+1]-c1[i]+1);
            string t2=s2.substr(c2[i],c2[i+1]-c2[i]+1);
            if(i%2)
            {
                if(t1!=t2)times++;
                if(times>1)break;
            }else
            {
                if(t1!=t2){times=10;break;}
            }
        }
        if(times>1)cout<<"DIFFERENT"<<endl;
        else if(times==1)cout<<"CLOSE"<<endl;
    }
}
