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<iostream>
#include<sstream>
#include<string>

int main(){
  while(1){
    std::string str1,str2;
    std::cin>>str1;
    if(str1==".") break;
    std::cin>>str2;
    std::string s1[201],s2[201];
    for(int i=0;i<201;i++){
      s1[i]=".";s2[i]=".";
    }
    s1[0]="";s2[0]="";
    int now1=0,now2=0;
    int l1,l2;
    l1=str1.size();
    l2=str2.size();
    for(int i=0;i<l1;i++){
      if(str1[i]=='"'){
	now1++;
	s1[now1]="";
      }else s1[now1]+=str1[i];
    }
    for(int i=0;i<l2;i++){
      if(str2[i]=='"'){
	now2++;
	s2[now2]="";
      }else s2[now2]+=str2[i];
    }
    int mistake=0;
    for(int i=0;i<201;i++){
      if(s1[i]!=s2[i]){
	if(i&1){
	  mistake++;
	}else mistake+=2;
      }
    }
    if(mistake==0){
      std::cout<<"IDENTICAL";
    }else if(mistake==1){
      std::cout<<"CLOSE";
    }else{
      std::cout<<"DIFFERENT";
    }
    std::cout<<"\n";
  }
  return 0;
}

C++: #include<iostream>
#include<string>

using namespace std;
typedef long long ll;

int main() {
	
	while (1) {
		string S1, S2;
		cin >> S1;
		if (S1 == ".")break;
		cin >> S2;
		//すでに完全に一致ならば
		if (S1 == S2) {
			cout << "IDENTICAL" << endl;
			continue;
		}
		//""をいずれかが含んでない場合
		int cnt1 = 0, cnt2 = 0;
		for (int i = 0; i < S1.size(); i++) {
			if (S1[i] == '"')cnt1++;
		}
		for (int i = 0; i < S2.size(); i++) {
			if (S2[i] == '"')cnt2++;
		}
		//この時、修正のやりようがないのでDIFFERENT
		if (!(cnt1 * cnt2)) {
			cout << "DIFFERENT" << endl;
			continue;
		}
		//""を圧縮する

		string B1, B2;
		for (int i = 0; i < S1.size() - 1; i++) {

			if (S1[i] == S1[i + 1] && S1[i] == '"') { i++; }
			else  B1 += S1[i];
		}
		for (int i = 0; i < S2.size() - 1; i++) {
			if (S2[i] == S2[i + 1] && S2[i] == '"') { i++; }
			else  B2 += S2[i];
		}
		if (S1[S1.size() - 1] != '"')B1 += S1[S1.size() - 1];
		if (S2[S2.size() - 1] != '"')B2 += S2[S2.size() - 1];
		S1 = B1, S2 = B2;

		//どちらにも""が含まれており、その中でさらに一つがすべて""である場合のフラグ
		bool f3 = false, f4 = false;
		//どちらも""が含まれてる場合
		string buf1, buf2;
		bool f2 = false;//""内にあるかどうかのフラグ
		cnt1 = 0, cnt2 = 0;//""の出現回数
		int pos1 = -1, pos2 = -1;//最初の"の場所
		for (int i = 0; i < S1.size(); i++) {
			if (!f2 && S1[i] == '"') {
				if (cnt1 == 0)pos1 = i;
				cnt1++;
				f2 = !f2;
				continue;
			}
			else if (f2 && S1[i] == '"') {
				cnt1++;
				f2 = !f2;
				continue;
			}
			if (!f2 || cnt1 >= 2) {
				buf1 += S1[i];

			}

		}
		f2 = false;
		for (int i = 0; i < S2.size(); i++) {
			if (!f2 && S2[i] == '"') {
				if (cnt2 == 0)pos2 = i;
				f2 = !f2;
				cnt2++;
				continue;
			}
			else if (f2 && S2[i] == '"') {
				cnt2++;
				f2 = !f2;
				continue;
			}

			if (!f2 || cnt2 >= 2)buf2 += S2[i];

		}

		if (buf1 == buf2 && (pos1 == pos2 || (pos1 == -1 && pos2 != -1) || (pos1 != -1 && pos2 == -1))) {
			cout << "CLOSE" << endl;
		}
		else cout << "DIFFERENT" << endl;
	}

	return 0;
}

C++: #include<bits/stdc++.h>

using namespace std;

#define rep(i,n) for(int i = 0; i < (n); ++i)

vector<string> f(string s){
    vector<string> ret;
    string a = "";
    for(auto c:s){
        if(c == '"'){
            ret.push_back(a);
            a = "";
        }else{
            a += c;
        }
    }
    ret.push_back(a);
    return ret;
}

int main(){
    string s,t;
    while(cin >> s, s!="."){
        cin >> t;
        if(s == t){
            cout << "IDENTICAL" << endl;
            continue;
        }
        auto a = f(s);
        auto b = f(t);

        //cout << "# "; for(auto&s:a) cout << s<< ";" ; cout << endl;
        //cout << "# "; for(auto&s:b) cout << s<< ";" ; cout << endl;

        if(a.size() != b.size()){
            cout << "DIFFERENT" << endl;
            continue;
        }
        int c = 0;
        rep(i, a.size()){
            if(a[i] != b[i]){
                if(i%2 == 1){
                ++c;
                }else{
                    c+= 100;
                }
            }
        }
        if(c <= 1){
            cout << "CLOSE" << endl;
        } else{
            cout << "DIFFERENT" << endl;
        }
    }
}

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

int main(){
	while(1){
		string s1,s2;
		cin>>s1;
		if(s1==".")return 0;
		cin>>s2;
		string s11[201],s22[201];
		for(int i=0;i<201;i++){
			s11[i]=".";s22[i]=".";
		}
		s11[0]="";s22[0]="";
		int now1=0,now2=0;
		for(int i=0;i<(int)s1.length();i++){
			if(s1[i]=='"'){
				now1++;
				s11[now1]="";
			}else s11[now1]+=s1[i];
		}
		for(int i=0;i<(int)s2.length();i++){
			if(s2[i]=='"'){
				now2++;
				s22[now2]="";
			}else s22[now2]+=s2[i];
		}
		int d=0;
		for(int i=0;i<201;i++){
			if(s11[i]!=s22[i]){
				if(i&1){
					d++;
				}else d+=2;
			}
		}
		if(d==0)cout<<"IDENTICAL";
		else if(d==1)cout<<"CLOSE";
		else cout<<"DIFFERENT";
		cout<<"\n";
	}
}