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 rep(i, n) for (int i = 0; i < (int)(n); i++)

int main(){
    while(1){
        string s, d;
        cin >> s >> d;
        if(s==".") break;
        string ans = "IDENTICAL";
        if(s == d){
            cout << ans << endl;
        }
        else{
            int len_s = s.length(), count_s = 0;
            int len_d = d.length(), count_d = 0;
            vector<int> flag_s(len_s+1);
            vector<int> flag_d(len_d+1);
            rep(i, len_s){
                if(s.at(i) == '"'){
                    count_s++;
                    flag_s.at(count_s) = i;
                }
            }
            rep(i, len_d){
                if(d.at(i) == '"'){
                    count_d++;
                    flag_d.at(count_d) = i;
                }
            }
            
            if(count_s != count_d){
                ans = "DIFFERENT";
                cout << ans << endl;
            }
            else{
                ans = "CLOSE";
                string a, b;
                int count = 0;
                //最初の部分文字列の比較
                a = s.substr(0, flag_s.at(0));
                b = d.substr(0, flag_d.at(0));
                if(a!=b){
                    ans = "DIFFERENT";
                }
                //最後の部分文字列の比較
                a = s.substr(flag_s.at(count_s), len_s-flag_s.at(count_s));
                b = d.substr(flag_d.at(count_d), len_d-flag_d.at(count_d));
                if(a!=b){
                    ans = "DIFFERENT";
                }
                rep(i, count_s){//部分文字列の比較
                    a = s.substr(flag_s.at(i), flag_s.at(i+1)-flag_s.at(i));
                    b = d.substr(flag_d.at(i), flag_d.at(i+1)-flag_d.at(i));
                    if(i%2 == 0){
                        if(a!=b){
                            ans = "DIFFERENT";
                        }
                    }
                    else{
                        if(a!=b){
                            count++;
                            if(count > 1){
                                ans = "DIFFERENT";
                            }
                        }
                    }
                }
                cout << ans << endl;
            }
        }
    }
    return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
#define r(i,n) for(int i=0;i<n;i++)
string a[2],b;
string s[2][1001];
int p[2];
void dfs(int x){
  r(i,a[x].size()){
    if(a[x][i]=='"'){
      i++;s[x][p[x]]+='"';
      while(i<a[x].size()&&a[x][i]!='"')s[x][p[x]]+=a[x][i++];
      p[x]++;
    }else{
      while(i<a[x].size()&&a[x][i]!='"')s[x][p[x]]+=a[x][i++];
      p[x]++;
      i--;
    }
  }
}
main(){
  while(cin>>a[0],a[0]!="."){
    cin>>a[1];
    p[0]=p[1]=0;
    r(i,2)r(j,1001)s[i][j]="";
    r(i,2)dfs(i);
    if(p[0]!=p[1])cout<<"DIFFERENT"<<endl;
    else{
      int f1=0,f2=0;
      r(i,p[0])if(s[0][i]!=s[1][i]){
        if(s[0][i][0]=='"'&&s[1][i][0]=='"')f1++;
        else f2++;
      }
      if(f2||f1>1)cout<<"DIFFERENT"<<endl;
      else if(f1)cout<<"CLOSE"<<endl;
      else cout<<"IDENTICAL"<<endl;
    }
  }
}