#define  _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream> 
#include <random>
#include<map>
#include <iomanip>
#include <time.h>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <cassert>
#include<fstream>
#include <unordered_map>  
using namespace std;
#define Ma_PI 3.141592653589793
#define eps 0.00000000000000000000000001
#define LONG_INF 10000000000000000
#define GOLD 1.61803398874989484820458
#define MAX_MOD 1000000007
#define REP(i,n) for(long long i = 0;i < n;++i)
int main() {
	while (true) {
		string a, b;
		cin >> a;
		if (a == ".") return 0;
		cin >> b;
		int ok = 1;
		vector<string> gogo[2][2];
		string now = "";
		int bad = 0;
		for (int i = 0; i < a.length(); ++i) {
			if (a[i] == '"') {
				gogo[0][bad].push_back(now);
				now = "";
				bad = (bad + 1) % 2;
			}
			else {
				now.push_back(a[i]);
			}
		}
		gogo[0][bad].push_back(now);
		now = "";
		for (int i = 0; i < b.length(); ++i) {
			if (b[i] == '"') {
				gogo[1][bad].push_back(now);
				now = "";
				bad = (bad + 1) % 2;
			}
			else {
				now.push_back(b[i]);
			}
		}
		gogo[1][bad].push_back(now);
		if (gogo[0][0] != gogo[1][0]||gogo[0][1].size() != gogo[1][1].size()) {
			cout << "DIFFERENT" << endl;
			continue;
		}
		int choice = 0;
		for (int q = 0; q < gogo[1][1].size(); ++q) {
			if (gogo[0][1][q] != gogo[1][1][q]) choice++;
		}
		if (choice == 0) {
			cout << "IDENTICAL" << endl;
		}
		else if (choice == 1) {
			cout << "CLOSE" << endl;
		}
		else cout << "DIFFERENT" << endl;
	}
}

