#include <bits/stdc++.h>
                                        #include<iostream>
                                        #include<cstdio>
                                        #include<vector>
                                        #include<queue>
                                        #include<map>
                                        #include<cstring>
                                        #include<string>
                                        #include <math.h>
                                        #include<algorithm>
                                    //    #include <boost/multiprecision/cpp_int.hpp>
                                        #include<functional>
                                #define int long long
                                        #define inf  1000000007
                                        #define pa pair<int,int>
                                        #define ll long long
                                        #define pal pair<double,pa>
                                        #define ppa pair<int,int>
                                        #define ppap pair<pa,pa>
                                        #define ssa pair<string,int>
                                        #define  mp make_pair
                                        #define  pb push_back
                                        #define EPS (1e-10)
                                        #define equals(a,b) (fabs((a)-(b))<EPS)
                                  #define VI vector<int>
                                        using namespace std;
                                        
                                  class pas{
                                    	public:
                                    	int x,y;
                                    	pas(int x=0,int y=0):x(x),y(y) {}
                                    	pas operator + (pas p) {return pas(x+p.x,y+p.y);}
                                    	pas operator - (pas p) {return pas(x-p.x,y-p.y);}
                                    	pas operator * (int a) {return pas(x*a,y*a);}
                                    	pas operator / (int a) {return pas(x/a,y/a);}
                                    //	double absv() {return sqrt(norm());}
                                    	int norm() {return x*x+y*y;}
                                    	bool operator < (const pas &p) const{
                                    		return x != p.x ? x<p.x: y<p.y;
                                    	}
                                    	bool operator == (const pas &p) const{
                                    		return x==p.x && y==p.y;
                                    	}
                                    };
int n,V,W,K,N,L,R;
vector<int>ve;

//int dp[2][10001]={0};
int a[1010] ;
int s;
           signed main(){
            string s1,s2;
           	while(cin>>s1){
           		if(s1==".")return 0;
           		cin>>s2;
           //		cout<<s1<<s2<<endl;
           		vector<int> ve1,ve2;
           		ve1.pb(-1);
           		ve2.pb(-1);
           		for(int i=0;i<s1.length();i++)if(s1[i]=='"')ve1.pb(i);
           		for(int i=0;i<s2.length();i++)if(s2[i]=='"')ve2.pb(i);
           		ve1.pb(s1.length());
           		ve2.pb(s2.length());
           		vector<string> ves1,ves2;
           		if(ve1.size()!=ve2.size()){
           			cout<<"DIFFERENT"<<endl;
           			continue;
           		}
           		for(int i=0;i<ve1.size()-1;i++){
           			ves1.pb(s1.substr(ve1[i]+1,ve1[i+1]-ve1[i]-1));
           			ves2.pb(s2.substr(ve2[i]+1,ve2[i+1]-ve2[i]-1));
           		}
           		
           		int ans=0;
           		for(int i=0;i<ves1.size();i++){
           			if(ves1[i]==ves2[i]) continue;
           			if(i%2) ans++;
           			else ans+=100;
           		}
           		if(ans>1) cout<<"DIFFERENT"<<endl;
           		else if(ans==1) cout<<"CLOSE"<<endl;
           		else cout<<"IDENTICAL"<<endl;
           		
           	}
           	
           	
           	
           	
           	
           }
             

Measured memory_bytes: 3164