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 a, b;
		cin >> a;
		if (a == ".") {
			break;
		}
		cin >> b;
		if (a == b) {
			cout << "IDENTICAL" << endl;
			continue;
		}
		int modea = 0, modeb = 0;
		int i = 0, j = 0, k = 0, c = 0,l=0;
		a.append("\0");
		while(a[i]!=NULL){
			if (a[i+j] == '"') {
				switch(modea) {
					case 0:
						modea = 1;
						break;
					case 1:
						modea = 0;
						i=i+j;
						j=0;
						break;
				}
			}
			if (b[i+k] == '"') {
				switch(modeb) {
					case 0:
						modeb = 1;
						break;
					case 1:
						modeb = 0;
						l=l+k;
						k=0;
						break;
				}
			}
			if (modea == 1 and modeb==1) {
			  //  cout<<a[i+j]<<b[i+k]<<endl;
				if (a[i + j] != b[l + k]) {
					c++;
					break;
				}
				j++;
				k++;
			}
			else if (modea == 1) {
				j++;
			}
			else if(modeb==1){
				k++;
			}
			if(modea==0 or modeb==0){
				if (a[i] != b[l]) {
					c = c + 2;
					break;
				}
				l++;
				i++;
			}
//	cout<<i<<l<<a[i]<<b[i]<<c<<endl;
		
		}
		if (c > 1) {
			cout << "DIFFERENT" << endl;
		}
		else {
			cout << "CLOSE" << endl;
		}
	}
}

C++: #include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<stack>

#define MOD 10000000
using namespace std; 
typedef long long LL;

long long quickpow(long long n, long long base) {
    long long res = 1;
    while(n) {
        if(n & 1) {
            res = res * base % MOD;
        }
        n >>= 1;
        base = base * base % MOD;
    }
    return res;
}//¿ìËÙÃÝ 
char A[100050];
char B[100050];
int main()
{
    cin>>A+1;
    while(A[1]!='.')
    {
		cin>>B+1;
    	int lenA=strlen(A+1);
    	int lenB=strlen(B+1);
    	int i=1,j=1;
    	int flag=0;
    	int k=0;
    	while(i<=lenA&&j<=lenB)
    	{
	    	if(A[i]==B[j])
	    	{
	     	    if(A[i]=='"'&&k){k=0;}
		        else if(A[i]=='"'&&!k){k=1;}


            	i++;j++;
	    	}
	    	else if(k==1)
	    	{
	    		while(A[i]!='"'&&i<=lenA)
	    		    i++;
   			    while(B[j]!='"'&&j<=lenB)
	    		    j++;
	    		    flag++;
	    		    i++;j++;
    		    k=0;
   
	    	}
	    	else if(k==0)
	    	{


	    		flag+=2;break;
	    	}
	    }
	    if(k==0&&i>lenA&&j<=lenB)flag+=2;
	    if(k==0&&j>lenB&&i<=lenA)flag+=2;
	    if(j>lenB&&A[i]=='"')flag+=2;
	    else if(i>lenA&&B[j]=='"')flag+=2;
	    else if(i>lenA&&j<=lenB)flag++;
	    else if(j>lenB&&i<=lenA)flag++;
    	if(flag==0)cout<<"IDENTICAL"<<endl;
    	if(flag==1)cout<<"CLOSE"<<endl;
    	if(flag>1)cout<<"DIFFERENT"<<endl;
    	cin>>A+1;
    }
}

C++: #include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<string>
#include<vector>
#include<list>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<cctype>
#include<climits>
#include<bitset>
#define ld long double
#define ll long long int
#define ull unsigned long long int
#define rep(i,n) for(i=0;i<n;i++)
#define fin(ans) cout<<(ans)<<endl
#define INF INT_MAX
#define vi vector<int>
#define vc vector<char>
#define vs vector<string>
#define vpii vector<pair<int,int> >
#define vvi vector<vector<int> >
#define vvc vector<vector<char> >
#define vvs vector<vector<string> >
#define P 1000000007
using namespace std;
template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
const long long LLINF=1LL<<60;
//set<int>::iterator it;
//|\_
//g++ -std=c++1z temp.cpp
//./a.out





int main(void){ios::sync_with_stdio(false);cin.tie(0);
//////////////////////////////////////////////////////
    string s,t;
    int i,j;
    while(1){
        cin>>s;
        if(s==".")break;
        cin>>t;
        if(s==t){
            cout<<"IDENTICAL"<<endl;
            continue;
        }
        if(count(s.cbegin(), s.cend(), '\"')!=count(t.cbegin(), t.cend(), '\"')){
            cout<<"DIFFERENT"<<endl;
            continue;
        }
        vector<string> v,w;
        string x="",y="";
        for(i=0;i<s.length();i++){
            if(s[i]=='\"'){
                j=1;
                v.push_back("");
                while(s[i+j]!='\"'){
                    v[v.size()-1]+=s[i+j];
                    j++;
                }
                i+=j;
                x+="¥";
            }
            else x+=s[i];
        }
        for(i=0;i<t.length();i++){
            if(t[i]=='\"'){
                j=1;
                w.push_back("");
                while(t[i+j]!='\"'){
                    w[w.size()-1]+=t[i+j];
                    j++;
                }
                i+=j;
                y+="¥";
            }
            else y+=t[i];
        }
        int wrong=0;
        rep(i,v.size())if(v[i]!=w[i])wrong++;
        if(x!=y)cout<<"DIFFERENT"<<endl;
        else if(wrong==1)cout<<"CLOSE"<<endl;
        else cout<<"DIFFERENT"<<endl;
    }
//////////////////////////////////////////////////////
return 0;}