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++: #include <bits/stdc++.h>

using namespace std;
typedef long long ll;
#define tr(container, it) \
        for (auto it = container.begin(); it != container.end(); it++)
#define scontains(c, x) ((c).find(x) != (c).end())   //O(log n)
#define contains(c, x) (find((c).begin(),(c).end(),x) != (c).end()) //O(n)
#define pll pair<ll,ll>
#define pii pair<int,int>
#define mll map<ll,ll>
#define in(x, a, b)((x)>=a && (x)<=b)
#define  rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define  _for(i, end) for (__typeof(end) i = 0; i < (end); i += 1)
#define all(x) (x).begin(),(x).end()
//#define len(array)  (sizeof(array)/sizeof((array)[0]))
#define endl '\n'
#define what_is(x) cerr << #x << " is " << x << endl;
#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
#define mod(x, m) ((((x) % (m)) + (m)) % (m))

void err(istream_iterator<string> it) {}

template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
    cerr << *it << " = " << a << endl;
    err(++it, args...);
}



const double PI = 2 * acos(.0);
const int INF = 0x3f3f3f3f;
const ll LLINF = 1000000000000000005LL;;
const ll MOD = (ll) (1e9) + 7;
void _mod(ll &x){x = mod(x, MOD);}
//const ll MOD = (ll) 998244353 ;
const double EPS = 1e-10;

int readint() {
    int x;
    cin >> x;
    return x;
}

template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val) {
    std::fill((T *) array, (T *) (array + N), val);
}

template<typename T>
ostream &operator<<(ostream &os, const vector<T> &v) {
    for (auto a : v)os << a << " ";
    return os;
}

template<typename T>
ostream &operator<<(ostream &os, const set<T> &v) {
    for (auto a : v)os << a << " ";
    return os;
}

ll power_mod(ll x, ll y, ll p) {
    if (y < 0)return 0;
    ll res = 1;

    x = x % p;

    while (y) {
        if (y & 1)
            res = (res * x) % p;
        y = y >> 1;
        x = (x * x) % p;
    }
    return res;
}

ll power(ll x, ll y) {
    if (y < 0)return 0;
    ll res = 1;
    while (y) {
        if (y & 1)
            res = (res * x);
        y = y >> 1;
        x *= x;
    }
    return res;
}

int fac[7777777];

void init(int MX) {
    fac[0] = 1;
    for (int i = 1; i <= MX; i++)
        fac[i] = fac[i - 1] * i % MOD;
}

// Returns n^(-1) mod p
int modInverse(int n, int p) {
    return power_mod(n, p - 2, p);
}

int comb_mod(int n, int r, int p) {
    if (r == 0)
        return 1;

    return (fac[n] * modInverse(fac[r], p) % p *
            modInverse(fac[n - r], p) % p) % p;
}

int comb(int a, int b) {
    int res = 1;
    rep(i, a + 1, a - b + 1)res *= i, res /= a - i + 1;
    //    rep(i,1,b+1)res /= i;
    return res;
}

bool equal(double a, double b) {
    return std::fabs(a - b) < std::numeric_limits<double>::epsilon();
}

struct UnionFind {
    // par[i]：データiが属する木の親の番号。i == par[i]のとき、データiは木の根ノードである
    vector<int> par;
    // sizes[i]：根ノードiの木に含まれるデータの数。iが根ノードでない場合は無意味な値となる
    vector<int> sizes;

    UnionFind(int n) : par(n), sizes(n, 1) {
        // 最初は全てのデータiがグループiに存在するものとして初期化
        rep(i, 0, n) par[i] = i;
    }

    // データxが属する木の根を得る
    int find(int x) {
        if (x == par[x]) return x;
        return par[x] = find(par[x]);  // 根を張り替えながら再帰的に根ノードを探す
    }

    // 2つのデータx, yが属する木をマージする
    void unite(int x, int y) {
        // データの根ノードを得る
        x = find(x);
        y = find(y);

        // 既に同じ木に属しているならマージしない
        if (x == y) return;

        // xの木がyの木より大きくなるようにする
        if (sizes[x] < sizes[y]) swap(x, y);

        // xがyの親になるように連結する
        par[y] = x;
        sizes[x] += sizes[y];
        // sizes[y] = 0;  // sizes[y]は無意味な値となるので0を入れておいてもよい
    }

    // 2つのデータx, yが属する木が同じならtrueを返す
    bool same(int x, int y) {
        return find(x) == find(y);
    }

    // データxが含まれる木の大きさを返す
    int size(int x) {
        return sizes[find(x)];
    }
};


//fastest
struct cpmFunctor {
    inline bool operator()(const pair<int, int> &p1, const pair<int, int> &p2) {
        return p1.first < p2.first || (p1.first == p2.first && p1.second < p2.second);
    }
};

bool isPrime(int n) {
    // Corner case
    if (n <= 1)
        return false;
    if (n == 2 || n == 3)return true;
    if (n % 2 == 0 || n % 3 == 0)return false;
    // Check from 2 to n-1
    for (int i = 5; i * i <= n; i += 6)
        if (n % i == 0)
            return false;
    for (int i = 7; i * i <= n; i += 6)
        if (n % i == 0)
            return false;

    return true;
}

int lcm(int a, int b) {
    return a / __gcd(a, b) * b;
}

void solve(){
    string s1, s2;
    while(cin >> s1 >> s2 && s1 != "."){
        string ss1, ss2;
        vector<string > v1, v2;
        vector<string>vv1, vv2;
        auto it1 = s1.begin();
        while(it1 != s1.end()){
            if(*it1 == '"'){
                string temp = "";
                it1++;
                while(*it1 != '"' && it1 != s1.end())temp += *it1,it1++;
                v1.emplace_back(temp);
                it1++;
            }
            else{
                string temp = "";
                while(*it1 != '"' && it1 != s1.end())temp += *it1,it1++;
                vv1.emplace_back(temp);
            }

        }
        auto it2 = s2.begin();
        while(it2 != s2.end()){
            if(*it2 == '"'){
                string temp = "";
                it2++;
                while(*it2 != '"' && it2 != s1.end())temp += *it2, it2++;
                v2.emplace_back(temp);
                it2++;
            }
            else{
                string temp = "";
                while(*it2 != '"' && it2!= s2.end())temp += *it2,it2++;
                vv2.emplace_back(temp);
            }
        }

        int dif = 0;
        if(v1.size() == v2.size()){
            _for(i,v1.size())if(v1[i] != v2[i])dif ++;
        }
        else dif = 100;
        cout << (vv1==vv2 && dif <=1 ?dif == 0 ? "IDENTICAL" : "CLOSE":"DIFFERENT") << endl;
    }

}


#undef int
int main() {
#if __MINGW32__
    freopen("../Input.txt", "r", stdin);
    freopen("../Output.txt", "w", stdout);

#endif

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    solve();

}