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 long long ll;

void split(string s, vector<string>&v){
    string tmp = "";
    for(int i = 0; i < s.size(); i++){
        if(s[i] == '"'){
            v.push_back(tmp);
            tmp = "";
        }
        else tmp += s[i];
    }
    if(tmp.size())v.push_back(tmp);
}

int main(){

    for(string s1;cin>>s1;){
        if(s1==".")break;
        string s2;
        cin >> s2;
        int cnt = 0;
        vector<string>v1, v2;
        split(s1, v1);
        split(s2, v2);
        if(v1.size() == v2.size()){
            for(int i = 0; i < v1.size(); i++){
                if(v1[i] != v2[i]){
                    if(i%2)cnt++;
                    else cnt = 2;
                }
            }
        }
        else{
            cnt = 2;
        }
        if(cnt == 0)cout << "IDENTICAL" << endl;
        if(cnt == 1)cout << "CLOSE" << endl;
        if(cnt > 1)cout << "DIFFERENT" << endl;
        
    }

    return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
#define r(i,n) for(int i=0;i<n;i++)
string a[2],b;
string s[2][1001];
int p[2];
void dfs(int x){
  r(i,a[x].size()){
    if(a[x][i]=='"'){
      i++;s[x][p[x]]+='"';
      while(i<a[x].size()&&a[x][i]!='"')s[x][p[x]]+=a[x][i++];
      p[x]++;
    }else{
      while(i<a[x].size()&&a[x][i]!='"')s[x][p[x]]+=a[x][i++];
      p[x]++;
      i--;
    }
  }
}
main(){
  while(cin>>a[0],a[0]!="."){
    cin>>a[1];
    p[0]=p[1]=0;
    r(i,2)r(j,1001)s[i][j]="";
    r(i,2)dfs(i);
    if(p[0]!=p[1])cout<<"DIFFERENT"<<endl;
    else{
      int f1=0,f2=0;
      r(i,p[0])if(s[0][i]!=s[1][i]){
        if(s[0][i][0]=='"'&&s[1][i][0]=='"')f1++;
        else f2++;
      }
      if(f2||f1>1)cout<<"DIFFERENT"<<endl;
      else if(f1)cout<<"CLOSE"<<endl;
      else cout<<"IDENTICAL"<<endl;
    }
  }
}

C++: #include <bits/stdc++.h>
using Int = int64_t;

std::vector<std::string> f(std::string ss) {
   std::vector<std::string> res;
   std::string buf;
   for(char c : ss) {
      if( c == '\"' ) {
         res.push_back(buf);
         buf.clear();
      }
      else {
         buf.push_back(c);
      }
   }
   res.push_back(buf);
   return res;
}

int main() {
   for(;;) {
      std::string s;
      std::cin >> s;
      if( s == "." ) break;
      std::string t;
      std::cin >> t;
      std::vector<std::string> xs = f(s);
      std::vector<std::string> ys = f(t);
      if( xs.size() != ys.size() ) {
         std::cout << "DIFFERENT" << std::endl;
         continue;
      }
      Int count_0 = 0;
      Int count_1 = 0;
      Int n = xs.size();
      for(Int i = 0; i < n; i+=2) {
         if( xs[i] != ys[i] ) {
            count_0 += 1;
         }
      }
      for(Int i = 1; i < n; i+=2) {
         if( xs[i] != ys[i] ) {
            count_1 += 1;
         }
      }
      if( count_0 == 0 && count_1 == 0 ) {
         std::cout << "IDENTICAL" << std::endl;
      }
      else if( count_0 == 0 && count_1 == 1 ) {
         std::cout << "CLOSE" << std::endl;
      }
      else {
         std::cout << "DIFFERENT" << std::endl;
      }
   }
}

C++: #include <bits/stdc++.h>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<string> vs;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<pll> vpll;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<30;
const ll INF=1ll<<60;
const double pi=acos(-1);
const double eps=1e-11;
const ll mod=1e9+7;
const int dx[4]={-1,0,1,0},dy[4]={0,-1,0,1};

vs f(string s){
	int n=s.size();
	vs a;
	string t;
	for(int i=0;i<n;i++){
		if(s[i]=='\"'){
			a.push_back(t);
			t="";
		}
		else t+=s[i];
	}
	a.push_back(t);
	return a;
}

string s,t;

int main(){
	while(1){
		cin>>s>>t;
		if(s==".") break;
		if(s==t){
			cout<<"IDENTICAL"<<endl;
			continue;
		}
		vs a=f(s),b=f(t);
		if(a.size()==b.size()){
			int t=0;
			for(int i=0;i<a.size();i++){
				if(a[i]!=b[i]){
					if(i%2==1) t++;
					else t=inf;
				}
			}
			if(t==1) cout<<"CLOSE"<<endl;
			else cout<<"DIFFERENT"<<endl;
		}
		else cout<<"DIFFERENT"<<endl;
	}
}