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;
const long long INF = (1LL << 32);
const long long MOD = 1000000007;
const long double PI = 3.1415926;
#define FOR(i,r,n) for(ll i = (ll)(r); i < (ll)(n); i++)
#define RFOR(i,r,n) for(ll i=(ll)(n-1);i>=r;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(x) x.begin(),x.end()
#define RALL(x) x.rbegin(),x.rend()
typedef long long int ll;
typedef vector<ll> vi;
typedef vector<pair<ll, ll>> vp;
typedef vector<string> vs;
typedef vector<char> vc;
typedef list<ll> lst;
typedef pair<ll, ll> P;
template <class T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template <class T> T &chmax(T &a, const T &b) { return a = max(a, b); }

ll n, m, k, ans = 0, sum = 0, cnt = 0;
string s;
char c;

#define Endl endl

/*--------------------template--------------------*/


int main() {
	string q, w;
	while(cin>>q){
		string e = ".";
		if(q==e){
			break;
		}
		cin >> w;
		string s, t;
		ans = 0;
		sum = 0;
		cnt = 0;
		s = '\"';
		s += q;
		s.push_back('\"');
		t = '\"';
		t += w;
		t.push_back('\"');
		if(s==t){
			cout << "IDENTICAL" << endl;
			continue;
		}
		vs vsa, vsb, vta, vtb;
		sum = 1;
		REP(i,s.size()) {
			if(s[i]=='\"'){
				if(sum==1){
					vsa.push_back(s.substr(cnt, i - cnt));
					cnt = i + 1;
					sum *= -1;
				}else if(sum==-1){
					vsb.push_back(s.substr(cnt, i - cnt));
					cnt = i + 1;
					sum *= -1;
				}
			}
		}

		cnt = 0;
		sum = 1;
		REP(i,t.size()) {
			if(t[i]=='\"'){
				if(sum==1){
					vta.push_back(t.substr(cnt, i - cnt));
					cnt = i + 1;
					sum *= -1;
				}else if(sum==-1){
					vtb.push_back(t.substr(cnt, i - cnt));
					cnt = i + 1;
					sum *= -1;
				}
			}
		}


		if(vsb.size()!=vtb.size()){
			cout << "DIFFERENT" << endl;
			continue;
		}
		bool f = false;
		REP(i,vsb.size()) {
			if(vsb[i]!=vtb[i]){
				cout << "DIFFERENT" << endl;
				f = true;
				break;
			}
		}
		if(f){
			continue;
		}

		REP(i,vsa.size()) {
			if(vsa[i]!=vta[i]){
				ans++;
			}
		}
		if(ans>1){
			cout << "DIFFERENT" << endl;
			continue;
		}
		if(ans==1){
			cout << "CLOSE" << endl;
			continue;
		}
	}
	return 0;
}

C++: #include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <utility>
#include <cstring>
#include <cmath>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <numeric> 
using namespace std;
typedef long long ll;
const int INF = 1<<30; 
const int MOD = 1e9 + 7;
const int dx[] = {1, 0, -1, 0};
const int dy[] = {0, 1, 0, -1};
int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
    string s, t;
    while(cin >> s)
    {
        if(s == ".") break;
        cin >> t;
        if(s == t)
        {
            cout << "IDENTICAL" << endl;
            continue;
        }
        bool flag = true;
        vector<string> v, w;
        int left, right;
        while((left = s.find('"')) != -1)
        {
            right = s.find('"', left + 1);
            v.push_back(s.substr(left, right - left + 1));
            s.replace(left, right - left + 1, "#");
        }
        while((left = t.find('"')) != -1)
        {
            right = t.find('"', left + 1);
            w.push_back(t.substr(left, right - left + 1));
            t.replace(left, right - left + 1, "#");
        }
        int cnt = 0;
        for(int i = 0; i < min(v.size(), w.size()); i++) if(v[i] != w[i]) cnt++;
        if(cnt < 2 && s == t) cout << "CLOSE" << endl;
        else cout << "DIFFERENT" << endl;
    }
	return 0;
}

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

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    string S,T;
    while(cin >> S,S!="."){
        cin >> T;
        string U="",V="";
        vector<string> s,t;
        int ok=0;
        for (int i=0;i<S.size();++i){
            if (S[i]=='\"'){
                ok^=1;
                if (ok) s.emplace_back("");
            }
            (ok?s.back():U)+=S[i];
        }
        ok=0;
        for (int i=0;i<T.size();++i){
            if (T[i]=='\"'){
                ok^=1;
                if (ok) t.emplace_back("");
            }
            (ok?t.back():V)+=T[i];
        }
        if (U!=V||s.size()!=t.size()){
            cout << "DIFFERENT" << '\n';
            continue;
        }
        int cnt=0;
        for (int i=0;i<s.size();++i)
            if (s[i]!=t[i]) ++cnt;
        cout << (!cnt?"IDENTICAL":(cnt==1?"CLOSE":"DIFFERENT")) << '\n';
    }
}