#include "bits/stdc++.h"
using namespace std;
typedef pair<string, int> token;
int main() {
	string s1, s2;
	while (cin >> s1, s1 != ".") {
		cin >> s2;
		vector<token> v1, v2;
		int pos = 0;
		while (pos < s1.size()) {
			if (s1[pos] == '"') {
				pos++;
				string s = "";
				while (pos < s1.size() && s1[pos] != '"') {
					s.push_back(s1[pos]);
					pos++;
				}
				v1.emplace_back(s, 1);
				pos++;
			}
			else {
				string s = "";
				while (pos < s1.size() && s1[pos] != '"') {
					s.push_back(s1[pos]);
					pos++;
				}
				v1.emplace_back(s, 0);
			}
		}
		pos = 0;
		while (pos < s2.size()) {
			if (s2[pos] == '"') {
				pos++;
				string s = "";
				while (s2[pos] != '"') {
					s.push_back(s2[pos]);
					pos++;
				}
				v2.emplace_back(s, 1);
				pos++;
			}
			else {
				string s = "";
				while (pos < s2.size() && s2[pos] != '"') {
					s.push_back(s2[pos]);
					pos++;
				}
				v2.emplace_back(s, 0);
			}
		}
		if (v1.size() != v2.size()) {
			cout << "DIFFERENT" << endl;
			continue;
		}
		bool ok = 1;
		int cnt = 0;
		for (int i = 0; i < v1.size(); i++) {
			if (v1[i].second != v2[i].second) {
				ok = 0;
				break;
			}
			else if (v1[i].second == 1) {
				if (v1[i].first != v2[i].first) cnt++;
			}
			else {
				if (v1[i].first != v2[i].first) {
					ok = 0;
					break;
				}
			}
		}
		if (ok) {
			if (cnt == 0) cout << "IDENTICAL" << endl;
			else if (cnt == 1) cout << "CLOSE" << endl;
			else cout << "DIFFERENT" << endl;
		}
		else {
			cout << "DIFFERENT" << endl;
		}
	}
}
