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>

#define ALL(a) (a).begin(), (a).end()
#define llong long long

using namespace std;

string pickword(const string &str, int &i){
	int j = 0;
	for(; i+j < str.size() && str[i+j] != '"'; j++);
	string ret = j == 0 ? "" : str.substr(i, j);
	i += j;
	return ret;
}

signed main(){
	while(true){
		string str; cin >> str;
		if(str == ".")break;
		string tgt; cin >> tgt;
		bool yellow = false;
		int ans = 1;
		for(int i = 0, j = 0; i < str.size() && j < str.size(); i++, j++){
			if(str[i] == tgt[j] && str[i] == '"'){
				i++; j++;
				string word = pickword(str, i);
				if(word != pickword(tgt, j)){
					if(yellow){
						ans = -1;
						break;
					}
					else{
						yellow = true;
						ans = 0;
					}
				}
			}
			if(str[i] != tgt[j]){
				ans = -1;
				break;
			}
		}
		if(ans == 1)cout << "IDENTICAL" << endl;
		else if(ans == 0)cout << "CLOSE" << endl;
		else cout << "DIFFERENT" << endl;
	}

	return 0;
}

C++: #include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
#define chmin(a, b) ((a)=min((a), (b)))
#define chmax(a, b) ((a)=max((a), (b)))
#define fs first
#define sc second
#define eb emplace_back
using namespace std;

typedef long long ll;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;

const ll MOD=1e9+7;
const ll INF=1e18;
const double pi=acos(-1);
const double eps=1e-10;

int dx[]={1, 0, -1, 0};
int dy[]={0, -1, 0, 1};

vector<string> calc(string s){
    vector<string> v;
    int pre = 0;
    for(int i=0; i<s.size(); i++){
        if(s[i] == '\"'){
            string t = s.substr(pre, i - pre + 1);
            v.eb(t);

            pre = i;
        }
    }

    string t = s.substr(pre, s.size() - 1 - pre + 1);
    v.eb(t);

    return v;
}

int main(){
    while(1){
        string s1; cin>>s1;
        if(s1 == ".") return 0;
        string s2; cin>>s2;

        if(s1 == s2){
            cout << "IDENTICAL" << endl;
            continue;
        }

        auto ans1 = calc(s1);
        auto ans2 = calc(s2);        

        int dif = 0;
        for(int i=0; i<ans1.size() && i<ans2.size(); i++){
            if(i % 2 == 0){
                if(ans1[i] != ans2[i]) dif = 2;
            }
            else{
                if(ans1[i] != ans2[i]) dif++;
            }
        }

        if(dif == 1){
            cout << "CLOSE" << endl;
        }
        else{
            cout << "DIFFERENT" << endl;
        }
    }
}

C++: #include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;

// region template
#define rep(i, a, b) for (int i = (a); i < (b); ++i)
#define trav(a, x) for (auto &a : x)
#define all(x) begin(x), end(x)
#define sz(x) (ll)(x).size()
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef vector<int> vi;

ll gcd(ll a, ll b) { return __gcd(a, b); }

ll euclid(ll a, ll b, ll &x, ll &y) {
    if (b) {
        ll d = euclid(b, a % b, y, x);
        return y -= a / b * x, d;
    }
    return x = 1, y = 0, a;
}

typedef unsigned long long ull;
typedef long double ld;
ull mod_mul(ull a, ull b, ull M) {
    ll ret = a * b - M * ull(ld(a) * ld(b) / ld(M));
    return ret + M * (ret < 0) - M * (ret >= (ll)M);
}
ull mod_pow(ull b, ull e, ull mod) {
    ull ans = 1;
    for (; e; b = mod_mul(b, b, mod), e /= 2)
        if (e & 1)
            ans = mod_mul(ans, b, mod);
    return ans;
}

const ll mod = 1000000007;
struct Mod {
    ll x;
    Mod(ll xx) : x(xx) {}
    Mod operator+(Mod b) { return Mod((x + b.x) % mod); }
    Mod operator-(Mod b) { return Mod((x - b.x) % mod); }
    Mod operator*(Mod b) { return Mod((x * b.x) % mod); }
    Mod operator/(Mod b) { return *this * invert(b); }
    Mod invert(Mod a) {
        ll x, y, g = euclid(a.x, mod, x, y);
        assert(g == 1);
        return Mod((x + mod) % mod);
    }
    Mod operator^(ll e) {
        if (!e)
            return Mod(1);
        Mod r = *this ^ (e / 2);
        r = r * r;
        return e & 1 ? *this * r : r;
    }
};
// endregion

int main() {
    cin.sync_with_stdio(0);
    cin.tie(0);
    cin.exceptions(cin.failbit);

    for (;;) {
        string s1, s2;
        cin >> s1;
        if (s1 == ".") break;
        cin >> s2;

        int st = 0; // 0 = same, 1 = close, >2 = different

        int p1 = 0, p2 = 0;
        while (p1 < s1.length() && p2 < s2.length()) {
            // cout << p1 << " " << p2 << endl;
            if (s1[p1] != s2[p2]) {st = 2, ++p1, ++p2; break; }
            else if (s1[p1] == s2[p2]) {
                if (s1[p1] == '"') {
                    // cout << p1 << " " << p2 << endl;
                    ++p1, ++p2;
                    string buf1, buf2;
                    while (s1[p1] != '"') buf1.push_back(s1[p1++]); ++p1;
                    while (s2[p2] != '"') buf2.push_back(s2[p2++]); ++p2;
                    if (buf1 != buf2) st++;
                } else ++p1, ++p2;
            }
        }

        if (p1 != s1.length() || p2 != s2.length()) st = 2;

        cout << (st == 0 ? "IDENTICAL" : st == 1 ? "CLOSE" : "DIFFERENT") << endl;
    }
}