#include <bits/stdc++.h>
using namespace std;



int main(){
//	cin.tie(0);
//	ios::sync_with_stdio(false);
	while(1){
		string s;
		cin >> s;
		if(s == ".") return 0;
		string t;
		cin >> t;
		vector<int> p, q;
		for(int i=0; i<s.size(); ++i)
			if(s[i] == '"') p.push_back(i);
		p.push_back(s.size());
		for(int i=0; i<t.size(); ++i)
			if(t[i] == '"') q.push_back(i);
		q.push_back(t.size());
//		for(int i=0; i<p.size(); ++i) cout << p[i] << (i==p.size()-1?"\n":" ");
//		for(int i=0; i<q.size(); ++i) cout << q[i] << (i==q.size()-1?"\n":" ");
		if(p.size() != q.size()){
			cout << "DIFFERENT\n";
			continue;
		}
		bool f = false;
		int cnt = 0;
		for(int i=0; i<p.size(); ++i){
			if(i % 2 == 0){
				if(i == 0 && s.substr(0, p[i]) != t.substr(0, q[i])){
					cout << "DIFFERENT\n";
					f = true;
					break;
				}else if(i != 0 && s.substr(p[i-1]+1, p[i]-p[i-1]-1) != t.substr(q[i-1]+1, q[i]-q[i-1]-1)){
					cout << "DIFFERENT\n";
					f = true;
					break;
				}
			}else{
				if(s.substr(p[i-1]+1, p[i]-p[i-1]-1) != t.substr(q[i-1]+1, q[i]-q[i-1]-1)){
					++cnt;
				}
			}
		}
		if(f) continue;
		if(cnt == 0) cout << "IDENTICAL\n";
		else if(cnt == 1) cout << "CLOSE\n";
		else cout << "DIFFERENT\n";
	}
}
