Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func main() {
	io := NewIo()
	defer io.Flush()
	for {
		s := io.NextLine()
		if s == "." {
			break
		}
		t := io.NextLine()
		if s == t {
			io.Println("IDENTICAL")
			continue
		}
		ss := strings.Split(s, "\"")
		tt := strings.Split(t, "\"")
		if len(ss) != len(tt) {
			io.Println("DIFFERENT")
			continue
		}
		cnt := 0
		for i := 0; i < len(ss); i++ {
			if i%2 == 0 {
				if ss[i] != tt[i] {
					cnt = -1
					break
				}
			} else {
				if ss[i] != tt[i] {
					cnt++
				}
			}
		}
		if cnt > 1 || cnt == -1 {
			io.Println("DIFFERENT")
		} else {
			io.Println("CLOSE")
		}
	}
}

// I/O template
type Io struct {
	reader    *bufio.Reader
	writer    *bufio.Writer
	tokens    []string
	nextToken int
}

func NewIo() *Io {
	return &Io{
		reader: bufio.NewReader(os.Stdin),
		writer: bufio.NewWriter(os.Stdout),
	}
}

func (io *Io) Flush() {
	err := io.writer.Flush()
	if err != nil {
		panic(err)
	}
}

func (io *Io) NextLine() string {
	var buff []byte
	for {
		line, isPrefix, err := io.reader.ReadLine()
		if err != nil {
			panic(err)
		}
		buff = append(buff, line...)
		if !isPrefix {
			break
		}
	}
	return string(buff)
}

func (io *Io) Next() string {
	for io.nextToken >= len(io.tokens) {
		line := io.NextLine()
		io.tokens = strings.Fields(line)
		io.nextToken = 0
	}
	s := io.tokens[io.nextToken]
	io.nextToken++
	return s
}

func (io *Io) NextInt() int {
	i, err := strconv.Atoi(io.Next())
	if err != nil {
		panic(err)
	}
	return i
}

func (io *Io) NextFloat() float64 {
	i, err := strconv.ParseFloat(io.Next(), 64)
	if err != nil {
		panic(err)
	}
	return i
}

func (io *Io) Println(a ...interface{}) {
	fmt.Fprintln(io.writer, a...)
}

func (io *Io) Printf(format string, a ...interface{}) {
	fmt.Fprintf(io.writer, format, a...)
}

func (io *Io) PrintIntSlice(a []int) {
	b := []interface{}{}
	for _, x := range a {
		b = append(b, x)
	}
	io.Println(b...)
}

func (io *Io) PrintStringSlice(a []string) {
	b := []interface{}{}
	for _, x := range a {
		b = append(b, x)
	}
	io.Println(b...)
}

func Log(name string, value interface{}) {
	fmt.Fprintf(os.Stderr, "%s=%+v\n", name, value)
}

func ExampleIo() {
	io := NewIo()
	defer io.Flush()
	a := make([]int, 0, 3)
	a[0], a[1], a[2] = io.NextInt(), io.NextInt(), io.NextInt()
	io.Println(a)
	io.PrintIntSlice(a)
	Log("io", a)
}

C++: //#pragma once
#include <stdio.h>
#include <string>
#include <iostream>
#include <queue>
#include <algorithm>
#include <sstream>
#include <vector>
#include <math.h>
#include <set>
#include <map>
#include <numeric>
#include<bitset>

using namespace std;
#define modd 1000000007
#define moda 1000003


typedef pair<long long, long long> pl;



#define ll long long




/*
class UnionFind {
public:
	vector <ll> par; 
	vector <ll> siz;
	vector <ll> gr;

	// Constructor
	UnionFind(ll sz_) : par(sz_), siz(sz_, 1LL) ,gr(sz_){
		for (ll i = 0; i < sz_; ++i) par[i] = i; 
	}
	void init(ll sz_) {
		par.resize(sz_);
		siz.assign(sz_, 1LL);  // resize だとなぜか初期化されなかった
		for (ll i = 0; i < sz_; ++i) par[i] = i; // 初期では親は自分自身
	}

	// Member Function
	// Find
	ll root(ll x) { // 根の検索
		while (par[x] != x) {
			x = par[x] = par[par[x]]; // x の親の親を x の親とする
		}
		return x;
	}

	// Union(Unite, Merge)
	bool merge(ll x, ll y) {
		x = root(x);
		y = root(y);
		if (x == y) return false;

		// merge technique（データ構造をマージするテク．小を大にくっつける）
		if (siz[x] < siz[y]) swap(x, y);
		siz[x] += siz[y];
		par[y] = x;
		return true;
	}



	bool issame(ll x, ll y) { // 連結判定
		return root(x) == root(y);
	}

	ll size(ll x) { // 素集合のサイズ
		return siz[root(x)];
	}


};*/


long long N, M, K, a, b, c, d,e, H, W;
long long A[200005] = {};
long long B[200005] = {};
long long C[200005] = {};
ll X[2][51] = {};
ll Y[2][51] = {};
ll sx, sy, ex, ey;
bool f, ff,fff;
string S[2];
set <long long>sll;
pl bufpl;
vector <long long>vl[100005];
vector <pl>vpl[2];
vector <string> vs[2];
set<ll> llset;

struct ST
{
	long long Kati;
	int bangou;

	bool operator<(const ST& another) const
	{
		return Kati < another.Kati;//比較
	};

};



vector <ST> vst;
ST st[200005];
ST bufst;
string bufS;

string sss;

bitset<5000> bits;

int main() {


	while (true) {
		cin >> S[0];
		if (S[0] == ".") {
			break;
		}
		cin >> S[1];



		a = 0;

		sss = "";
		bufS = sss;

		for (int i = 0; i < S[0].size(); i++) {

			if (S[0][i] == '"') {
				if (a % 2 == 0) {
					vs[0].push_back(bufS);
					bufS = sss;
				}
				else {
					vs[0].push_back(bufS);
					bufS = sss;
				}


				a++;
			}
			else {
				bufS += S[0][i];
				if (i == S[0].size() - 1) {
					vs[0].push_back(bufS);
					bufS = sss;
				}
			}
			

		}

		a = 0;

		sss = "";
		bufS = sss;

		for (int i = 0; i < S[1].size(); i++) {

			if (S[1][i] == '"') {
				if (a % 2 == 0) {
					vs[1].push_back(bufS);
					bufS = sss;
				}
				else {
					vs[1].push_back(bufS);
					bufS = sss;
				}


				a++;
			}
			else {
				bufS += S[1][i];
				if (i == S[1].size() - 1) {
					vs[1].push_back(bufS);
					bufS = sss;
				}
			}


		}

		if (vs[0].size() != vs[1].size()) {
			cout << "DIFFERENT" << endl;
		}
		else {
			a = 0;
			for (int i = 0; i < vs[0].size(); i++) {

				
				if (vs[0][i] != vs[1][i]) {
					if (i % 2 == 0) {
						a += 2;
					}
					else {
						a++;
					}
				}

				
				

			}

			if (a == 0) {
				cout << "IDENTICAL" << endl;
			}
			else if (a == 1) {
				cout << "CLOSE" << endl;
			}
			else {
				cout << "DIFFERENT" << endl;
			}

		}


		vs[0].clear();
		vs[1].clear();
		

	}

	return 0;

}