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;

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";
	}
}

C++: #include<iostream>
#include<cstdio>
#include<vector>

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

using namespace std;

const string Y = "IDENTICAL";
const string N = "DIFFERENT";
const string C = "CLOSE";

string elim(string s) {
  string ret = "";
  bool toggle = false;
  rep(i,(int)s.size()) {
    if( s[i] == '"' ) { 
      if( toggle ) ret += "@";
      toggle = !toggle;
      continue;
    }
    if( toggle ) continue;
    ret += s[i];
  }
  return ret;
}

vector<string> extr(string s) {
  vector<string> vec;
  bool toggle = false;
  string buf = "";
  rep(i,(int)s.size()) {
    if( s[i] == '"' ) {
      if( toggle ) {
	vec.push_back(buf);
	buf = "";
      }
      toggle = !toggle;
      continue;
    }
    if( !toggle ) continue;
    buf += s[i];
  }
  return vec;
}

int main() {
  string s,t;
  while( cin >> s, s[0] != '.' ) {
    cin >> t;
    if( s == t ) {
      puts(Y.c_str());
    } else if( elim(s) != elim(t) ) {
      puts(N.c_str());
    } else {
      vector<string> v1 = extr(s);
      vector<string> v2 = extr(t);
      int diff = 0;
      if( v1.size() != v2.size() ) {
	puts(N.c_str());
      } else {
	rep(i,(int)v1.size()) {
	  if( v1[i] != v2[i] ) {
	    ++diff;
	    continue;
	  }
	}
	( diff == 1 ) ? puts(C.c_str()) : puts(N.c_str());
      }
    }
  }
  return 0;
}

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

using namespace std;

string s,ss;
vector<int>pos,poss;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);

    int diff;
    while (cin>>s)
    {
        if (s[0]=='.') break;

        cin>>ss;
        int Ls=s.size(),Lss=ss.size();

        diff=0;
        if (s==ss) cout<<"IDENTICAL"<<endl;
        else
        {
            int i=0,j=0;
            while (s[i]==ss[j] && i<Ls && j<Lss)
            {
                if (s[i]=='"')
                {
                    i++;j++;
                    while (s[i]==ss[j] && s[i]!='"' && ss[j]!='"') {i++;j++;}
                    if (s[i]!='"' && ss[j]!='"')
                    {
                        diff++;
                    }
                    while (s[i]!='"') i++;
                    while (ss[j]!='"') j++;
                }
                if (diff>=2) break;
                i++;j++;
            }
            if (i!=Ls || j!=Lss) diff+=2;
            if (diff>=2) cout<<"DIFFERENT"<<endl;
            else cout<<"CLOSE"<<endl;
        }

    }

    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;
		int cnt3 = 0, cnt4 = 0;
		for (int i = 0; i < S1.size() - 1; i++) {

			if (S1[i] == S1[i + 1] && S1[i] == '"' && cnt3 % 2 == 0) { i++; }
			else {
				if (S1[i] == '"')cnt3++;
				B1 += S1[i];
			}
		}
		for (int i = 0; i < S2.size() - 1; i++) {
			if (S2[i] == S2[i + 1] && S2[i] == '"' && cnt4 % 2 == 0) { i++; }
			else {
				if (S2[i] == '"')cnt4++;
				B2 += S2[i];
			}
		}
		if (S1[S1.size() - 1] != '"' || (S1[S1.size() - 1] == '"' && cnt3 % 2 == 1))B1 += S1[S1.size() - 1];
		if (S2[S2.size() - 1] != '"' || (S2[S2.size() - 1] == '"' && cnt4 % 2 == 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;
}