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 <cstdio>
#include <algorithm>
#include <cstring>

using namespace std;

int main()
{
    int k,l,la,lb,ans,stat,poi;
    char a[205],b[205];
    scanf("%s",a);//getchar();
    while(a[0]!='.' || a[1]!='\0')
    {
        scanf("%s",b);//getchar();
        ans=stat=k=l=poi=0;
        la=strlen(a);lb=strlen(b);
        while(1)
        {
            if(a[k]=='"' && b[l]=='"')
            {
                if(stat)stat=0;
                else stat=1;
            }
            if(a[k]==b[l])
            {
                k++;l++;
                if(k==la || l==lb)
                {
                    if(k!=la || l!=lb)ans=2;
                    break;
                }
            }
            else
            {
                while(a[k]!='"' && k<la)k++;
                while(b[l]!='"' && l<lb)l++;
                if(stat)
                {
                    if(poi)
                    {
                        ans=2;
                        break;
                    }
                    else
                    {
                        poi++;
                        ans=1;
                    }
                }
                else
                {
                    ans=2;
                    break;
                }
            }
        }
        if(ans==0)printf("IDENTICAL\n");
        if(ans==1)printf("CLOSE\n");
        if(ans==2)printf("DIFFERENT\n",ans);
        scanf("%s",a);
    }
    return 0;
}

C++: /*#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cmath>
#include<map>
#include<cstdio>
#include<stack>
#include<queue>
#include<fstream>
#include<cstdio>
#include<deque>
#include<iomanip>
#include <random>

using namespace std;
#define ok1 printf("ok1\n");
#define ok2 printf("ok2\n");
#define M 1000000000000000000LL
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,s,n) for(int i=(s);i<(n);i++)
#define repr(i,n) for(int i=n-1;i>=0;i--)
#define REPR(i,s,n) for(int i=(s);i>=(n);(i)--)
#define all(a) (a).begin(),(a).end()
#define reall(a) (a).rbegin(),(a).rend()
#define pb push_back
#define pf push_front
#define MIN(a,b) a=min((a),(b))
#define MAX(a,b) a=max((a),(b))
#define SIZE(v) (int)v.size()
const double pi = acos(-1.0);

typedef vector<int> vi;
typedef vector<string> vs;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef deque<ll> dll;
#define mod 1e9 + 7;

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);
	cout.setf(ios::fixed);
	cout.precision(20);

	vs v;
	string s1, s2;
	vs cs1, cs2;
	while (true) {
		cin >> s1;
		if (s1 == ".") break;
		cin >> s2;
		ll sum = 0;
		if (s1 == s2) v.pb("IDENTICAL");
		else {
			rep(i, s1.size()) {
				rep(j, s1.size()) {
					if (i != j && s1[i] == '"' && s1[j] == '"') {
						cs1.pb(s1.substr(i + 1, j - 1));
						s1[i] = '0'; s1[j] = '0';
					}

				}
			}
			rep(i, s2.size()) {
				rep(j, s2.size()) {
					if (i != j && s2[i] == '"' && s2[j] == '"') {
						cs2.pb(s2.substr(i + 1, j - 1));
						s2[i] = '0'; s2[j] = '0';
					}

				}
			}
			rep(i, cs1.size()) {
				cout << cs1[i] << " " << cs2[i] << endl;
				if (cs1[i] != cs2[i]) sum++;
				if (sum == 2) break;
			}
			if (sum == 1) v.pb("CLOSE");
			else v.pb("DIFFERENT");
		}
	}
	rep(i, v.size()) cout << v[i] << endl;
	return 0;
}*/
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cmath>
#include<map>
#include<cstdio>
#include<stack>
#include<queue>
#include<fstream>
#include<cstdio>
#include<deque>
#include<iomanip>

using namespace std;
#define ok1 printf("ok1\n");
#define ok2 printf("ok2\n");
#define M 1000000000000000000LL
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,s,n) for(int i=(s);i<(n);i++)
#define repr(i,n) for(int i=n-1;i>=0;i--)
#define REPR(i,s,n) for(int i=(s);i>=(n);(i)--)
#define all(a) (a).begin(),(a).end()
#define reall(a) (a).rbegin(),(a).rend()
#define pb push_back
#define pf push_front
#define MIN(a,b) a=min((a),(b))
#define MAX(a,b) a=max((a),(b))
#define SIZE(v) (int)v.size()
const double pi = acos(-1.0);

typedef vector<int> vi;
typedef vector<string> vs;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef deque<ll> dll;
#define mod 1e9 + 7;

bool check(string s1, string s2) {
	//cout << s1 << " " << s2 << endl;
	ll l = 0, r = 0, cnt = 0;
	while(l < s1.size() || r < s2.size()) {
		if (s1.size() == l || s2.size() == r) return false;
		if (s1[l] != s2[r]) return false;
		if (s1[l] == '"') {
			l++;
			string ss = "";
			while (s1[l] != '"') {
				ss += s1[l];
				l++;
			}
			l++;
			r++;
			string ss2 = "";
			while (s2[r] != '"') {
				ss2 += s2[r];
				r++;
			}
			r++;
			if (ss != ss2) cnt++;
		}
		else {
			l++; r++;
		}
	}
	if (l == s1.size() && r == s2.size() && cnt <= 1) return true;
	else return false;
}
int main()
{
	ios_base::sync_with_stdio(false);

	string s1,s2;
	while (cin >> s1) {
		if (s1 == ".") break;
		cin >> s2;
		if (s1 == s2) cout << "IDENTICAL" << endl;
		else {
			if (check(s1, s2)) {
				cout << "CLOSE" << endl;
			}
			else cout << "DIFFERENT" << endl;

		}
	}
	return 0;
}