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++: #define _CRT_SECURE_NO_WARNINGS

#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <cstring>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <list>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <unordered_set>
#include <unordered_map>
#include <array>
#include <cassert>
#include <bitset>
using namespace std;
using LL = long long;

int main() {
	string s, t;
	while (cin >> s, (s != ".")) {
		cin >> t;
		if (s == t) {
			cout << "IDENTICAL" << endl;
			continue;
		}
		vector<int>P, Q;
		for (int i = 0; i < s.size(); ++i) {
			if (s[i] == '\"')P.push_back(i);
		}
		for (int i = 0; i < t.size(); ++i) {
			if (t[i] == '\"')Q.push_back(i);
		}
		if (P.size() != Q.size()) {
			cout << "DIFFERENT" << endl;
			continue;
		}
		bool ok = false;
		for (int a = 0; a < P.size(); a += 2) {
			int p1 = P[a], p2 = P[a + 1];
			int q1 = Q[a], q2 = Q[a + 1];
			string Sleft = s.substr(0, p1);
			string Sright = s.substr(p2 + 1, s.size() - p2 - 1);
			string Tleft = t.substr(0, q1);
			string Tright = t.substr(q2 + 1, t.size() - q2 - 1);
			if (Sleft == Tleft && Sright == Tright) {
				ok = true;
				break;
			}
		}
		if (ok) {
			cout << "CLOSE" << endl;
		}
		else {
			cout << "DIFFERENT" << endl;
		}
	}
}

C++: #include <bits/stdc++.h>

using namespace std;

inline int ctoi(char c) { if(c < '0' || '9' < c) throw invalid_argument("ctoi error"); return c - '0'; }
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define REP(i, k, n) for(int i = (int)(k); i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()

template <typename T>
inline T gcd(T x, T y){
	if (x <= 0 || y <= 0) throw invalid_argument("gcd error: x <= 0 or y <= 0");
	
	if(x < y) swap(x, y);
	T r = x % y;

	while(r != 0){
		x = y;
		y = r;
		r = x % y;
	}

	return y;
}
template <typename T>
inline T lcm(T x, T y){
	if (x <= 0 || y <= 0) throw invalid_argument("lcm error: x <= 0 or y <= 0");

	return x * y / gcd(x, y);
}

int main(){
	vector<string> ans;

	while(1){
		string str1;
		cin >> str1;
		if(str1 == ".") break;

		string str2;
		cin >> str2;

		vector<vector<char>> vec1;
		vector<vector<char>> vec2;

		vector<char> v;
		int d = 0;
		rep(i, str1.size()){
			if(str1[i] == '"'){
				d++;

				if(d % 2 == 1){
					if(v.size() != 0){
						vec1.push_back(v);
						v.clear();
					}

					v.push_back('"');
				}
				else{
					v.push_back('"');
					vec1.push_back(v);
					v.clear();
				}
			}
			else{
				v.push_back(str1[i]);
			}
		}

		if (v.size() != 0){
			vec1.push_back(v);
			v.clear();
		}

		d = 0;

		rep(i, str2.size()){
			if (str2[i] == '"'){
				d++;

				if (d % 2 == 1){
					if (v.size() != 0){
						vec2.push_back(v);
						v.clear();
					}

					v.push_back('"');
				}
				else{
					v.push_back('"');
					vec2.push_back(v);
					v.clear();
				}
			}
			else{
				v.push_back(str2[i]);
			}
		}

		if (v.size() != 0){
			vec2.push_back(v);
			v.clear();
		}

		d = 0;
		
		/*
		cout << "input1:" << endl;
		rep(i, vec1.size())
		{
			rep(j, vec1[i].size())
			{
				cout << vec1[i][j];
			}

			cout << endl;
		}
		cout << endl;

		cout << "input2:" << endl;
		rep(i, vec2.size())
		{
			rep(j, vec2[i].size())
			{
				cout << vec2[i][j];
			}

			cout << endl;
		}
		cout << endl;
		*/

		if (vec1.size() != vec2.size()){
			ans.push_back("DIFFERENT");
		}
		else{
			int diff = 0;
			int dq = 0;

			rep(i, vec1.size()){
				if (vec1[i] != vec2[i]){
					if(vec1[i][0] == '"'){
						diff++;
					}
					else{
						diff += 2;
					}
				}
			}

			// cout << diff << endl;

			if(diff == 0) ans.push_back("IDENTICAL");
			else if(diff == 1) ans.push_back("CLOSE");
			else ans.push_back("DIFFERENT");
		}
	}

	rep(i, ans.size()){
		// cout << i << " : " << ans[i];
		cout << ans[i] << endl;
	}

	return 0;
}