#include <iostream>
#include <string>
#include <vector>

using namespace std;

int main() {
	string s1, s2;
	while (cin >> s1) {
		if (s1 == ".") {
			break;
		}
		cin >> s2;

		if (s1 == s2) {
			cout << "IDENTICAL" << endl;
		}
		else {
			int s1c = 0;
			vector<string> s11;
			string subs1 = "";
			string kk = "";
			for (int i = 0; i < s1.size(); i++) {
				if (s1[i] == '"') {
					subs1 += '"';
					s1c++;
					if (s1c % 2 == 0) {
						s11.push_back('"' + kk + '"');
						kk = "";
					}
				}
				else if (s1c % 2 != 0) {
					kk += s1[i];
				}
				else {
					subs1 += s1[i];
				}
			}
			int s2c = 0;
			vector<string> s22;
			string subs2 = "";
			for (int i = 0; i < s2.size(); i++) {
				if (s2[i] == '"') {
					subs2 += '"';
					s2c++;
					if (s2c % 2 == 0) {
						s22.push_back('"' + kk + '"');
						kk = "";
					}
				}
				else if (s2c % 2 != 0) {
					kk += s2[i];
				}
				else {
					subs2 += s2[i];
				}
			}
			if (subs1 == subs2 && s11.size() == s22.size()) {
				int cc = 0;
				for (int i = 0; i < s11.size(); i++) {
					if (s11[i] != s22[i]) {
						cc++;
					}
				}
				if (cc == 1) {
					cout << "CLOSE" << endl;
				}
				else {
					cout << "DIFFERENT" << endl;
				}
			}
			else {
				cout << "DIFFERENT" << endl;
			}
		}

	}
	return 0;
}
