#include<bits/stdc++.h>
using namespace std;
 
#define rep(i,m,n) for(int i = (m); i < (int)(n); i++)
#define rrep(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define vsort(v) sort(v.begin(), v.end());
#define rvsort(v) sort(v.begin(), v.end(),greater<int>());
#define YES cout<<"YES"<< endl
#define NO cout<<"NO"<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl  
#define yes cout<<"yes"<<endl
#define no cout<<"no"<<endl
#define ret return
#define lb(v,n) lower_bound(v.begin(),v.end(),n)
#define ub(v,n) upper_bound(v.begin(),v.end(),n)
#define mae(v) max_element(v.begin(),v.end())
#define mie(v) min_element(v.begin(),v.end())
#define INF 0x7FFFFFFF
#define mod 1000000007
#define fir first
#define sec second
typedef long long ll;
////////////////////////////////////////////////////////////

vector<pair<string,bool>> hoge( string s ){
	vector<pair<string,bool>> arr;
	string tmp = "";
	bool f1 = 0;
	rep(i,0,s.size()){
		if( !f1 && s[i] == '"' ){
			f1 = 1;
			arr.push_back( make_pair(tmp,0));
			tmp = "";
		}
		else if( f1 && s[i] == '"' ){
			f1 = 0;
			arr.push_back( make_pair(tmp,1));
			tmp = "";
		}
		else{
			tmp += s[i];
		}
	}
	if( tmp.size() > 1 )
		arr.push_back( make_pair(tmp,0));
	ret arr;
}

int main(){
	while(1){
		string s1,s2;
		cin >> s1;
		if( s1 == ".") break;
		cin >> s2;
		vector<pair<string,bool>> arr1 = hoge(s1) , arr2 = hoge(s2);

		/*
		rep( i,0,arr1.size()) cout << arr1[i].fir << " " << arr1[i].sec << endl;
		rep( i,0,arr2.size()) cout << arr2[i].fir << " " << arr2[i].sec << endl;
		*/

		int cnt = 0;

		if( arr1.size() != arr2.size() ) cnt += 100;
		rep(i,0,min( arr1.size() , arr2.size() )){
			if( arr1[i].sec != arr2[i].sec ) cnt += 100;
			else if( arr1[i].fir != arr2[i].fir){
				if( arr1[i].sec == 1 )
					cnt++;
				else
					cnt += 100;
			}
		}

		if( cnt == 0 ) cout << "IDENTICAL" << endl;
		else if( cnt == 1 ) cout << "CLOSE" << endl;
		else cout << "DIFFERENT" << endl;
	}
	ret 0;
}
