#include "bits/stdc++.h"

#define REP(i, n ,N) for(ll i = (n); i < (N); i++)
#define p(s) cout<<(s)<<endl
#define p2(a, b) cout<<(a)<<" "<<(b)<<endl
using namespace std;
typedef long long ll;
ll MOD = 1e9+7;
ll inf = 1e18;

string s1, s2;

vector<string> split_string(string s, char c){
	vector<string> s_vec;
	ll pre = 0;
	REP(i,0,s.size()){
		if(s[i] == c){
			s_vec.push_back(s.substr(pre, i-pre));
			pre = i+1;
		}
	}
	s_vec.push_back(s.substr(pre, s.size()-pre));
	return s_vec;
}
int main() {
	while (cin >> s1 && s1 != ".") {
		cin >> s2;
		ll no_match = 0;
		vector<string> s1_vec = split_string(s1, '"');
		vector<string> s2_vec = split_string(s2, '"');
		if(s1_vec.size() != s2_vec.size()){
			no_match = 2;
		}else{
			REP(i,0, s1_vec.size()){
				if(s1_vec[i] != s2_vec[i]){
					if(i%2) no_match++;
					else no_match = 2;
				}
			}
		}

		if(no_match == 0){
			p("IDENTICAL");
		}else if(no_match == 1){
			p("CLOSE");
		}else{
			p("DIFFERENT");
		}
	}

	return 0;
}
