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;
using ll=long long;
using vb=vector<bool>;
using vvb=vector<vb>;
using vd=vector<double>;
using vvd=vector<vd>;
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using pii=pair<int,int>;
using pll=pair<ll,ll>;
using tll=tuple<ll,ll>;
using tlll=tuple<ll,ll,ll>;
using vs=vector<string>;

#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rep(i,n) range(i,0,n)
#define rrep(i,n) for(int i=(n)-1;i>=0;i--)
#define range(i,a,n) for(int i=(a);i<(n);i++)

#define LINF ((ll)1ll<<60)
#define INF ((int)1<<30)
#define EPS (1e-9)
#define MOD (1000000007ll)
#define fcout(a) cout<<setprecision(a)<<fixed
#define fs first
#define sc second
#define PI 3.1415926535897932384

int dx[]={1,0,-1,0,1,-1,-1,1},dy[]={0,1,0,-1,1,1,-1,-1};

template<class T>bool chmax(T&a,T b){if(a<b){a=b; return true;}return false;}
template<class T>bool chmin(T&a,T b){if(a>b){a=b; return true;}return false;}
template<class S>S acm(vector<S>&a){return accumulate(all(a),S());}
template<class S>S max(vector<S>&a){return *max_element(all(a));}
template<class S>S min(vector<S>&a){return *min_element(all(a));}
void YN(bool b){cout<<(b?"YES":"NO")<<"\n";}
void Yn(bool b){cout<<(b?"Yes":"No")<<"\n";}
void yn(bool b){cout<<(b?"yes":"no")<<"\n";}

ll max(int a,ll b){return max((ll)a,b);} ll max(ll a,int b){return max(a,(ll)b);}
template<class T>void puta(T&&t){cout<<t<<"\n";}
template<class H,class...T>void puta(H&&h,T&&...t){cout<<h<<' ';puta(t...);}
template<class S,class T>ostream&operator<<(ostream&os,pair<S,T>p){os<<"["<<p.first<<", "<<p.second<<"]";return os;};
template<class S>auto&operator<<(ostream&os,vector<S>t){bool a=1; for(auto s:t){os<<(a?"":" ")<<s;a=0;} return os;}

void solve(string s){
	string t,ans;
	cin>>t;
	int cnt=0,pos=0;
	vs sa,sb,ta,tb;
	rep(i,s.size()){
		if(s[i]=='"'){
			sa.push_back(s.substr(pos,i-pos));
			range(j,i+1,s.size()){
				if(s[j]=='"'){
					sb.push_back(s.substr(i+1,j-i-1));
					pos=j+1;
					i=j;
					j=s.size();
				}
			}
		}
	}
	sa.push_back(s.substr(pos,s.size()-pos));
	pos=0;
	rep(i,t.size()){
		if(t[i]=='"'){
			ta.push_back(t.substr(pos,i-pos));
			range(j,i+1,t.size()){
				if(t[j]=='"'){
					tb.push_back(t.substr(i+1,j-i-1));
					pos=j+1;
					i=j;
					j=t.size();
				}
			}
		}
	}
	ta.push_back(t.substr(pos,t.size()-pos));
	ans="IDENTICAL";
	if(sb.size()!=tb.size())ans="DIFFERENT";
	else{
		rep(i,sb.size())if(sb[i]!=tb[i])cnt++;
		if(cnt>1)ans="DIFFERENT";
		if(cnt==1)ans="CLOSE";
	}
	if(sa.size()!=ta.size())ans="DIFFERENT";
	else{
		rep(i,sa.size())if(sa[i]!=ta[i])ans="DIFFERENT";
	}
	cout<<ans<<endl;
	
}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	string s;
	while(cin>>s,s!=".")solve(s);
}

C++: #include <iostream>
#include <string>
#define MAX 100

int main(){
    std::string str1, str2;
    std::cin >> str1 >> str2;

    int set[MAX];
    int i_set = 0;
    while(str1 != "."){
        int flag1 = 0;     //0:IDENTICAL 1:CLOSE 2:DIFFERENT
        int flag2 = 4;     //3:[""]の内部 4:[""]の外部
        int cnt = 0;
        int n1 = (int)str1.size();
        int n2 = (int)str2.size();
        int j1 = 0;
        int j2 = 0;
        while(j1<n1 || j2<n2){
            if(flag2==4){//外部ならば
                if((str1[j1]!=str2[j2]) || (j1==n1&&j2!=n2) || (j1!=n1&&j2==n2)){
                    flag1 = 2;
                    break;
                }
                else if(str1[j1]=='\"' && str2[j2]=='\"'){//ともに[""]の内部に入る
                    flag2 = 3;
                    if(j1<n1)  j1 += 1;
                    if(j2<n2)  j2 += 1;
                }
            }
            if(flag2==3){//内部ならば
                if(str1[j1]!=str2[j2]){
                    if(flag1!=1){
                        flag1 = 1;
                    }
                    else if(flag1==1){
                        flag1 = 2;
                        break;
                    }
                    while(str1[j1]!='\"'){
                        j1 += 1;
                    }
                    while(str2[j2]!='\"'){
                        j2 += 1;
                    }
                    flag2 = 4;
                }
                else if(str1[j1]=='\"' && str2[j2]=='\"'){
                    flag2 = 4;
                }
            }
            if(j1<n1)  j1 += 1;
            if(j2<n2)  j2 += 1;
        }
        set[i_set] = flag1;
        i_set += 1;
        str1.erase(str1.begin(), str1.end());
        str2.erase(str2.begin(), str2.end());
        std::cin >> str1;
        if(str1 != "."){
            std::cin >> str2;
        }
    }

    for(int k=0; k<i_set; k++){
        if(set[k] == 0)  std::cout << "IDENTICAL\n";
        if(set[k] == 1)  std::cout << "CLOSE\n";
        if(set[k] == 2)  std::cout << "DIFFERENT\n";
    }

    return 0;
}