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 ll long long
#define rep(i,n) for(ll (i)=0;(i)<(n);(i)++)
using namespace std;

int main(){
    while(true){
        string str[2];
        cin>>str[0];
        if(str[0]==".")return 0;
        cin>>str[1];
        bool flag=false;
        vector<vector<ll>> mozi(2,vector<ll>());
        vector<vector<ll>> soto(2,vector<ll>());
        rep(nnn,2){
            rep(i,str[nnn].size()){
                if(str[nnn][i]=='"'){
                    if(flag){
                        flag=false;
                        soto[nnn].push_back(0);
                    }else{
                        flag=true;
                        mozi[nnn].push_back(0);
                    }
                }else{
                    if(flag){
                        mozi[nnn][mozi[nnn].size()-1]+=str[nnn][i];
                    }else{
                        if(soto[nnn].size()==0)soto[nnn].push_back(0);
                        soto[nnn][soto[nnn].size()-1]+=str[nnn][i];
                    }
                }
            }
        }
        ll wn=0;
        if(mozi[0].size()!=mozi[1].size() || soto[0].size()!=soto[1].size()){
            cout<<"DIFFERENT"<<endl;
            continue;
        }
        bool f=false;
        rep(i,soto[0].size()){
            if(soto[0][i]!=soto[1][i]){
                cout<<"DIFFERENT"<<endl;
                f=true;
                break;
            }
        }
        if(f){
            continue;
        }
        rep(i,mozi[0].size()){
            if(mozi[0][i]!=mozi[1][i]){
                wn++;
            }
        }
        if(wn==0){
            cout<<"IDENTICAL"<<endl;
        }else if(wn==1){
            cout<<"CLOSE"<<endl;
        }else{
            cout<<"DIFFERENT"<<endl;
        }
    }
}

C++: #include <bits/stdc++.h>
using namespace std;
#define dump(x) cout << (x) << '\n';
#define fi first
#define se second
typedef int64_t Int;
Int mod = 1e9+7;
Int INF = 1e9+7;

int main() {
    while (true) {
        string s, t;
        cin >> s;
        if (s[0] == '.') break;
        cin >> t;
        vector<string> odd1, even1, odd2, even2;
        string add = "";
        bool oe = false;
        for (int i = 0; i < (int)s.size(); i++) {
            if (s[i] == '"')  {
                if (oe) {
                    even1.emplace_back(add);
                }
                else {
                    odd1.emplace_back(add);
                }
                oe = !oe;
                add = "";
            }
            else {
                add = add + s[i];
                if (i == (int)s.size() - 1) {
                    if (oe) {
                        even1.emplace_back(add);
                    }
                    else {
                        odd1.emplace_back(add);
                    }
                    oe = !oe;
                    add = "";
                }
            }
        }
        oe = false;
        add = "";
        for (int i = 0; i < (int)t.size(); i++) {
            if (t[i] == '"')  {
                if (oe) {
                    even2.emplace_back(add);
                }
                else {
                    odd2.emplace_back(add);
                }
                oe = !oe;
                add = "";
            }
            else {
                add = add + t[i];
                if (i == (int)t.size() - 1) {
                    if (oe) {
                        even2.emplace_back(add);
                    }
                    else {
                        odd2.emplace_back(add);
                    }
                    oe = !oe;
                    add = "";
                }
            }
        }
        if (odd1.size() != odd2.size() || even1.size() != even2.size()) {
            dump("DIFFERENT");
            continue;
        }
        bool x = false;
        for (int i = 0; i < (int)odd1.size(); i++) {
            if (odd1[i] != odd2[i]) x = true;
        }
        if (x) {
            dump("DIFFERENT");
            continue;
        }
        int cnt = 0;
        for (int i = 0; i < (int)even1.size(); i++) {
            if (even1[i] != even2[i]) cnt++;
        }
         if (cnt == 0) {
        dump("IDENTICAL");
    }
    else if (cnt == 1) {
        dump("CLOSE");
    }
    else {
        dump("DIFFERENT");
    }
    }
    return 0;
}