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 int long long
signed main(){
  string s,t;
  while(cin>>s,s!="."){
    cin>>t;
    if(s==t){
      cout<<"IDENTICAL"<<endl;
      continue;
    }
    string u,v;
    int n=s.size(),m=t.size();
    vector<string> vs,vt;
    for(int i=0;i<n;i++){
      if(s[i]=='\"'){
	u+=s[i];
	string x;
	i++;
	while(s[i]!='\"') x+=s[i++];
	vs.push_back(x);
	u+=s[i];
	continue;
      }
      u+=s[i];
    }
    for(int i=0;i<m;i++){
      if(t[i]=='\"'){
	v+=t[i];
	string x;
	i++;
	while(t[i]!='\"') x+=t[i++];
	vt.push_back(x);
	v+=t[i];
	continue;
      }
      v+=t[i];
    }
    if(u!=v||vs.size()!=vt.size()){
      cout<<"DIFFERENT"<<endl;
      continue;
    }
    int dif=0;
    for(int i=0;i<(int)vs.size();i++) dif+=(vs[i]!=vt[i]);
    if(dif==1){
      cout<<"CLOSE"<<endl;
      continue;
    }
    cout<<"DIFFERENT"<<endl;
  }
  return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
const long long INF = (1LL << 32);
const long long MOD = 1000000007;
const long double PI = 3.1415926;
#define FOR(i,r,n) for(ll i = (ll)(r); i < (ll)(n); i++)
#define RFOR(i,r,n) for(ll i=(ll)(n-1);i>=r;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(x) x.begin(),x.end()
#define RALL(x) x.rbegin(),x.rend()
typedef long long int ll;
typedef vector<ll> vi;
typedef vector<pair<ll, ll> > vp;
typedef vector<string> vs;
typedef vector<char> vc;
typedef list<ll> lst;
typedef pair<ll, ll> P;
template <class T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template <class T> T &chmax(T &a, const T &b) { return a = max(a, b); }

ll n, m, k, ans = 0, sum = 0, cnt = 0;
string s;
char c;

#define Endl endl

/*--------------------template--------------------*/


int main() {
	string q, w;
	while(cin>>q){
		string e = ".";
		if(q==e){
			break;
		}
		cin >> w;
		string s, t;
		ans = 0;
		sum = 0;
		cnt = 0;
		s = '\"';
		s += q;
		s.push_back('\"');
		t = '\"';
		t += w;
		t.push_back('\"');
		if(s==t){
			cout << "IDENTICAL" << endl;
			continue;
		}
		vs vsa, vsb, vta, vtb;
		sum = 1;
		REP(i,s.size()) {
			if(s[i]=='\"'){
				if(sum==1){
					vsa.push_back(s.substr(cnt, i - cnt));
					cnt = i + 1;
					sum *= -1;
				}else if(sum==-1){
					vsb.push_back(s.substr(cnt, i - cnt));
					cnt = i + 1;
					sum *= -1;
				}
			}
		}

		cnt = 0;
		sum = 1;
		REP(i,t.size()) {
			if(t[i]=='\"'){
				if(sum==1){
					vta.push_back(t.substr(cnt, i - cnt));
					cnt = i + 1;
					sum *= -1;
				}else if(sum==-1){
					vtb.push_back(t.substr(cnt, i - cnt));
					cnt = i + 1;
					sum *= -1;
				}
			}
		}


		if(vsb.size()!=vtb.size()){
			cout << "DIFFERENT" << endl;
			continue;
		}
		bool f = false;
		REP(i,vsb.size()) {
			if(vsb[i]!=vtb[i]){
				cout << "DIFFERENT" << endl;
				f = true;
				break;
			}
		}
		if(f){
			continue;
		}

		REP(i,vsa.size()) {
			if(vsa[i]!=vta[i]){
				ans++;
			}
		}
		if(ans>1){
			cout << "DIFFERENT" << endl;
			continue;
		}
		if(ans==1){
			cout << "CLOSE" << endl;
			continue;
		}
	}
	return 0;
}