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;
#define int long long
#define fi first
#define se second
#define pb push_back
#define rep(i, s, n) for (int i = s; i < n; i++)
#define rrep(i, s, n) for (int i = (n)-1; i >= (s); i--)
#define all(a) a.begin(),a.end()
const long long MOD = 1e9+7, INF = 1e18;
template<class T>inline bool chmax(T&a,T b){if(a<b){a=b;return true;}return false;}
template<class T>inline bool chmin(T&a,T b){if(a>b){a=b;return true;}return false;}

string s,t;



signed main(){
	vector<string>ans;
	while(cin>>s,s!="."){
        cin>>t;
        int diff = 0;
        string ss="",tt="";
        vector<string>svec,tvec;
        rep(i,0,s.size()){
            if(s[i]=='"'){
                svec.push_back(ss);
                ss = "";
            }
            else ss += s[i];
        }
		svec.push_back(ss);
        rep(i,0,t.size()){
            if(t[i]=='"'){
                tvec.push_back(tt);
                tt = "";
            }
            else tt += t[i];
        }
		tvec.push_back(tt);
		if(svec.size()!=tvec.size()){
			ans.push_back("DIFFERENT");
			continue;
		}
        rep(i,0,svec.size()){
            if(svec[i]!=tvec[i]){
                if(i%2==0)diff += 101010;
                else diff += 1;
            }
        }
        if(diff==0)ans.push_back("IDENTICAL");
        else if(diff==1)ans.push_back("CLOSE");
        else ans.push_back("DIFFERENT");
    }
	for(auto e:ans){
		cout<<e<<endl;
	}
}

C++: #include <bits/stdc++.h>
using namespace std;



int main(){
//	cin.tie(0);
//	ios::sync_with_stdio(false);
	while(1){
		string s;
		cin >> s;
		if(s == ".") return 0;
		string t;
		cin >> t;
		vector<int> p, q;
		for(int i=0; i<s.size(); ++i)
			if(s[i] == '"') p.push_back(i);
		p.push_back(s.size());
		for(int i=0; i<t.size(); ++i)
			if(t[i] == '"') q.push_back(i);
		q.push_back(t.size());
//		for(int i=0; i<p.size(); ++i) cout << p[i] << (i==p.size()-1?"\n":" ");
//		for(int i=0; i<q.size(); ++i) cout << q[i] << (i==q.size()-1?"\n":" ");
		if(p.size() != q.size()){
			cout << "DIFFERENT\n";
			continue;
		}
		bool f = false;
		int cnt = 0;
		for(int i=0; i<p.size(); ++i){
			if(i % 2 == 0){
				if(i == 0 && s.substr(0, p[i]) != t.substr(0, q[i])){
					cout << "DIFFERENT\n";
					f = true;
					break;
				}else if(i != 0 && s.substr(p[i-1]+1, p[i]-p[i-1]-1) != t.substr(q[i-1]+1, q[i]-q[i-1]-1)){
					cout << "DIFFERENT\n";
					f = true;
					break;
				}
			}else{
				if(s.substr(p[i-1]+1, p[i]-p[i-1]-1) != t.substr(q[i-1]+1, q[i]-q[i-1]-1)){
					++cnt;
				}
			}
		}
		if(f) continue;
		if(cnt == 0) cout << "IDENTICAL\n";
		else if(cnt == 1) cout << "CLOSE\n";
		else cout << "DIFFERENT\n";
	}
}

C++: #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vd = vector<double>;
using vvd = vector<vd>;
using vl = vector<ll>;
using vvl = vector<vl>;
using pii = pair<int, int>;
using vs = vector<string>;
#define rep(i,n) range(i,0,n)
#define range(i,a,n) for(int i=a;i<n;i++)
#define LINF ((ll)1ll<<60)
#define INF ((int)1<<30)
#define EPS (1e-9)
#define MOD (1000000007)
#define fcout(a) cout<<setprecision(a)<<fixed
#define fs first
#define sc second
#define PI 3.141592653589793

template<class S, class T>ostream&operator<<(ostream&os, pair<S, T>p)
{
	os << "[" << p.first << "," << p.second << "]"; return os;
}
template<class S>auto&operator<<(ostream&os, vector<S>t)
{
	bool a = 1; for (auto s : t) { os << (a ? "" : " ") << s; a = 0; }
	return os;
}

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	string s1, s2;
	while (cin >> s1, s1!="." ) {
		cin >> s2;
		vector<pair<string, int>> tok1(1);
		vector<pair<string, int>> tok2(1);
		int inner = 0;
		for (auto c : s1) {
			if (c == '"') {
				if (inner == 0) {
					inner = 1;
				}
				else {
					inner = 0;
				}
				tok1.emplace_back("", inner);
			}
			else {
				tok1.back().first += c;
			}
		}
		inner = 0;
		for (auto c : s2) {
			if (c == '"') {
				if (inner == 0) {
					inner = 1;
				}
				else {
					inner = 0;
				}
				tok2.emplace_back("", inner);
			}
			else {
				tok2.back().first += c;
			}
		}
		int ans = 0;
		if (tok1.size() == tok2.size()) {
			int diff = 0;
			rep(i, tok1.size()) {
				if (tok1[i].sc != tok2[i].sc) {
					ans = 2; break;
				}
				else {
					if (tok1[i].sc == 0) {
						if (tok1[i].fs != tok2[i].fs) {
							ans = 2;
							break;
						}
					}
					else {
						if (tok1[i].fs != tok2[i].fs) {
							ans++;
						}
					}
				}
			}
		}
		else {
			ans = 2;
		}
		if (ans == 0)cout << "IDENTICAL" << endl;
		else if (ans == 1)cout << "CLOSE" << endl;
		else cout << "DIFFERENT" << endl;
	}
	return 0;
}