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 <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>

using namespace std;
#define int long long int
const int INF = 1001001001001001LL;

int di[] = {-1, 0, 1, 0, -1, 1, 1, -1};
int dj[] = {0, 1, 0, -1, 1, 1, -1, -1};

void f(string s, vector<string> &sr, vector<string> &si){
    
    int mode = 0;
    string str = "";
    for(int i = 0; i < (int)s.size(); i++){
        if(s[i] == '\"'){
            if(mode == 0){
                sr.push_back(str);
            }else{
                si.push_back(str);
            }
            mode = (mode + 1) % 2;
            str = "";
        }else{
            str = str + s.substr(i, 1);
        }
    }
}

signed main(){
    
    while(1){
        string s; cin >> s;
        if(s == ".") break;
        string t; cin >> t;



        if(s == t){
            cout << "IDENTICAL" << endl;
            continue;
        }

        s = s + "\"";
        t = t + "\"";
        
        vector<string> sr;
        vector<string> si;
        vector<string> tr;
        vector<string> ti;

        f(s, sr, si);
        f(t, tr, ti);
        /*
        for(auto st : sr) cout << st << endl;
        cout << endl;
        for(auto st : si) cout << st << endl;
        cout << endl;
        for(auto st : tr) cout << st << endl;
        cout << endl;
        for(auto st : ti) cout << st << endl;
        */
        // お前さんは似ているのか?
        if(sr != tr || si.size() != ti.size()){
            cout << "DIFFERENT" << endl;
            continue;
        }
        
        int cnt = 0;
        for(int i = 0; i < (int)si.size(); i++){
            if(si[i] != ti[i]) cnt++;
        }

        if(cnt <= 1) cout << "CLOSE" << endl;
        else 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<<"DIFERENT"<<endl;
      else if(f1)cout<<"CLOSE"<<endl;
      else cout<<"IDENTICAL"<<endl;
    }
  }
}