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;
typedef pair<bool,string> P;

vector<P> parse(string s)
{
	vector<P> ret;
	int i=0;
	while(i<s.size())
	{
		if(s[i]=='\"')
		{
			string tmp;
			i++;
			while(s[i]!='\"')
			{
				tmp+=s[i];
				i++;
			}
			ret.push_back(P(true,tmp));
			i++;
		}else{
			string tmp;
			while(i<s.size() && s[i]!='\"')
			{
				tmp+=s[i];
				i++;
			}
			ret.push_back(P(false,tmp));
		}
	}
	return ret;
}

int main()
{
	while(1)
	{
		string s1;
		string s2;
		cin>>s1;
		if(s1==".")
			break;
		cin>>s2;
		if(s1==s2)
			cout<<"IDENTICAL"<<endl;
		else{
			vector<P> p1=parse(s1);
			vector<P> p2=parse(s2);
			if(p1.size()!=p2.size())
				cout<<"DIFFERENT"<<endl;
			else{
				bool f=true;
				int cnt=0;
				for(int i=0;i<p1.size();i++)
				{
					if(p1[i].first!=p2[i].first)
					{
						f=false;
						break;
					}else{
						if(p1[i].first)
						{
							if(p1[i].second!=p2[i].second)
								cnt++;
						}else{
							if(p1[i].second!=p2[i].second)
							{
								f=false;
								break;
							}
						}
					}
				}
				if(!f)
					cout<<"DIFFERENT"<<endl;
				else if(cnt==1)
					cout<<"CLOSE"<<endl;
				else
					cout<<"DIFFERENT"<<endl;
			}
		}
	}
	return 0;
}

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

void f(string s,string t){
  vector<string> sv,sw,tv,tw;

  int j=0;
  string u;
  for(int i=0;i<s.size();i++){

    if(s[i]=='\"'){
      if(j%2){
        sw.PB(u);
      }
      else{
        sv.PB(u);
      }
      u="";
      j++;
    }
    else{
      u+=s[i];
    }
  }
  if(j%2){
    sw.PB(u);
  }
  else{
    sv.PB(u);
  }
  u="";
  j++;


  j=0;
  
  for(int i=0;i<t.size();i++){
    if(t[i]=='\"'){
      if(j%2){
        tw.PB(u);
      }
      else{
        tv.PB(u);
      }
      u={};
      j++;
    }
    else{
      u+=t[i];
    }
  }
  
  if(j%2){
    tw.PB(u);
  }
  else{
    tv.PB(u);
  }
  u="";
  j++;


  if(sv.size()!=tv.size()||sw.size()!=tw.size()){
    cout<<"DIFFERENT"<<endl;
    return;
  }

  for(int i=0;i<sv.size();i++){
    if(sv[i]!=tv[i]){
      cout<<"DIFFERENT"<<endl;
      return;
    }
  }

  int d=0;
  for(int i=0;i<sw.size();i++){
    if(sw[i]!=tw[i]){
      d++;
    }
  }

  if(d>1){
    cout<<"DIFFERENT"<<endl;
    return;
  }
  if(d==1){
    cout<<"CLOSE"<<endl;
    return;
  }

  cout<<"IDENTICAL"<<endl;
}




int main(){
  string s,t;
  while(true){
    cin>>s;
    if(s==".") break;
    cin>>t;
    f(s,t);
  }

}

C++: #include<iostream>
using namespace std;
typedef long long ll; 
const ll mod=1e9+7;
int n,m;
int a[1001];
int cnt1,cnt0;
int main() {	
	//freopen("slyar.in", "r", stdin);  
    //freopen("slyar.out", "w", stdout);
    ios::sync_with_stdio(false);
  	cin.tie(0);
    string s1;
    string s2;
    cin>>s1;
    while(s1!=".")
    {
    	cin>>s2;
    	if(s1==s2) cout<<"IDENTICAL"<<endl;
    	else
    	{
    		string temp1,temp2;
    		int flag=0;
    		cnt0=0,cnt1=0;
			int i=0,j=0;
			int num1=0,num2=0;
			for(int k=0;k<s1.length();k++)
			{
				if(s1[k]=='"') num1++;
			}
			for(int k=0;k<s2.length();k++)
			{
				if(s2[k]=='"') num2++;
			}
			if(num1!=num2)
			{
				cout<<"DIFFERENT"<<endl;
				cin>>s1;
				continue;
			}
    		while(cnt1<2&&cnt0==0)
    		{
    			if(i==s1.length()&&j<s2.length())
    			{
    				cnt0=1;
    				break;
    			}
    			else if(i<s1.length()&&j==s2.length())
    			{
    				cnt0=1;
    				break;
    			}
    			else if(i==s1.length()&&j==s2.length())
    			{
    				break;
    			}
    			else
    			{
    			    for(;i<s1.length();i++)
    			    {
    			    	temp1+=s1[i];
    			    	if(s1[i]=='"')
    			    	{
    			    		if(flag==0) flag=1;
    			    		else flag=0;
    			            i++;
    			            break;
    			    	}
    			    }
    			    for(;j<s2.length();j++)
    			    {
    			    	temp2+=s2[j];
    			    	if(s2[j]=='"')
    			    	{
    			            j++;
    			            break;
    			    	}
    			    }
    			    //cout<<flag<<endl;
    			    if(!flag)
    			    {
    			    if(temp1!=temp2) cnt1++;	
    			    }
    			    else
    			    {
    			    	if(temp1!=temp2) cnt0++;
    			    }
    			//	cout<<temp1<<endl;
    			//	cout<<temp2<<endl;
    				temp1.clear();temp2.clear();
    			}
			} 
			if(cnt1==1&&cnt0==0) cout<<"CLOSE"<<endl;
			else cout<<"DIFFERENT"<<endl;
    	}
    	cin>>s1;
    }
	//fclose(stdin);
    //fclose(stdout);
    return 0;
}