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 <string>
using namespace std;

int main()
{
	while(true){
		string s1;
		cin >> s1;

		if(s1==".")
			break;

		string s2;
		cin >> s2;

		if(s1==s2){
			cout << "IDENTICAL" << endl;
			continue;
		}

		string t1 = s1;
		string t2 = s2;

		while(true){
			size_t d1b = t1.find('\"');
			if(d1b==string::npos)
				break;
			t1.replace(d1b, 1, "@");

			size_t d1e = t1.find('\"');
			t1.replace(d1e, 1, "@");

			size_t d2b = t2.find('\"');
			if(d2b==string::npos)
				break;
			t2.replace(d2b, 1, "@");

			size_t d2e = t2.find('\"');
			t2.replace(d2e, 1, "@");

			string u1 = s1;
			u1.replace(d1b+1, d1e-d1b-1, "");
			string u2 = s2;
			u2.replace(d2b+1, d2e-d2b-1, "");

			if(u1==u2){
				t1 = u1;
				t2 = u2;
				break;
			}
		}

		if(t1==t2){
			cout << "CLOSE" << endl;
		}
		else{
			cout << "DIFFERENT" << endl;
		}
	}

	return 0;
}

C++: #include <bits/stdc++.h>
  
using namespace std;
  
#define rep(i,n) REP(i,0,n)
#define REP(i,s,e) for(int i=(s); i<(int)(e); i++)
#define pb push_back
#define all(r) r.begin(),r.end()
#define rall(r) r.rbegin(),r.rend()
#define fi first
#define se second
  
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
 
const int INF = 1e9;
const ll MOD = 1e9 + 7;
double EPS = 1e-8;

#define DEBUG_MODE
#ifdef DEBUG_MODE
#define dump(x) cout << #x << " : " << x << endl
#define LINE cout << "line : " << __LINE__ << endl
#define dumpV(v) cout << #v << " : ["; for(auto& t : v) cout << t << ", "; cout<<"]" << endl;
#define STOP assert(false);
#else
#define dump(x) ;
#define LINE 	;
#define dumpV(v);
#define STOP 	;
#endif

namespace std{
  template<class S,class T>
  ostream &operator <<(ostream& out,const pair<S,T>& a){
    out<<'('<<a.fi<<", "<<a.se<<')';
    return out;
  }
}


vector<string> split(const string& s, char c = ' ') {
	vector<string> ret;
	stringstream ss(s);
	string t;
	while(getline(ss, t, c)) ret.push_back(t);
	return ret;
}

int main(){
	string s, t;
	while(cin >> s) {
		if(s == ".") break;
		cin >> t;
		if(s == t) {
			cout << "IDENTICAL" << endl;
			continue;
		}
		auto vs = split(s, '\"');
		auto vt = split(t, '\"');
		if(vs.size() != vt.size()) {
			cout << "DIFFERENT" << endl;
			continue;
		}
		int diff = 0;
		for(int i = 0; i < vs.size(); i+= 2) {
			if(vs[i] != vt[i]) diff++;
		}
		if(diff > 0) {
			cout << "DIFFERENT" << endl;
			continue;
		}
		for(int i = 1; i < vs.size(); i += 2) {
			if(vs[i] != vt[i]) diff++;
		}
		cout << (diff == 1 ? "CLOSE" : "DIFFERENT") << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <string>
using namespace std;

int main(){
	while(true){
		string s1;
		cin>>s1;
	
		if(s1==".")
			break;
	
		string s2;
		cin>>s2;

		if(s1==s2){
			cout<<"IDENTICAL"<<endl;
			continue;
		}

		string t1=s1;
		string t2=s2;

		while(true){
			size_t d1b=t1.find('\"');
			if(d1b==string::npos)
				break;
			t1.replace(d1b, 1, "@");

			size_t d1e=t1.find('\"');
			t1.replace(d1e, 1, "@");

			size_t d2b=t2.find('\"');
			if(d2b==string::npos)
				break;
			t2.replace(d2b, 1, "@");
		
			size_t d2e=t2.find('\"');
			t2.replace(d2e, 1, "@");

			string u1=s1;
			u1.replace(d1b+1, d1e-d1b-1, "");
			string u2=s2;
			u2.replace(d2b+1, d2e-d2b-1, "");

			if(u1==u2){
				t1=u1;
				t2=u2;
				break;
			}
		}
		
		if(t1==t2){
			cout<<"CLOSE"<<endl;
		}else{
			cout<<"DIFFEREVT"<<endl;
		}
	}
	
	return 0;
}

C++: #include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
const int INF=INT_MAX,MOD=1e9+7;

int main(){
    string s1,s2;
    while(cin>>s1>>s2&&s1!="."){
        if(s1==s2){
            cout<<"IDENTICAL"<<endl;
            continue;
        }
        int i=0,j=0,cnt=0;
        int n=s1.size(),m=s2.size();
        bool mark=0; //奇数
        while(1){
            string a1,a2;
            while(1){
                if(s1[i]=='"'||i>=n){
                    mark=!mark;
                    i++; break;
                }
                else a1+=s1[i];
                i++;
            }
            while(1){
                if(s2[j]=='"'||j>=m){
                    j++; break;
                }
                else a2+=s2[j];
                j++;
            }
            //cout<<a1<<" "<<a2<<endl;
            if(a1!=a2&&mark) cnt+=100;
            else if(a1!=a2) cnt++;
            if(i>=n&&j>=m) break;
        }
        if(cnt==1) cout<<"CLOSE"<<endl;
        else cout<<"DIFFERENT"<<endl;
    }
    return 0;
}

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

using namespace std;

int main () {
	string s1, s2;
	while (cin >> s1, s1 != ".") { 
		cin >> s2;
		if (s1 == s2) {
			cout << "IDENTICAL" << endl;
			continue;
		}
		bool quote = false, flag = true;
		int mcnt = 0, i = 0, j = 0;
		while (i < s1.size () && j < s2.size ()) {
			if (s1[i] == '"' && s2[j] == '"') quote ^= true;
			if (s1[i] != s2[j]) {
				if (!quote || mcnt >= 1) {
					flag = false;
					break;
				}
				while (s1[i] != '"') i++;
				while (s2[j] != '"') j++;
				mcnt++;
				quote = false;
			}
			i++, j++;
		}
		if (i != s1.size () || j != s2.size ()) flag = false;
		cout << (flag ? "CLOSE" : "DIFFERENT") << endl;
	}

	return 0;
}