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;
#define FOR(i,a,b) for(int i = (a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
#define fi first
#define se second
template<typename A, typename B> inline bool chmax(A &a, B b) { if (a<b) { a=b; return 1; } return 0; }
template<typename A, typename B> inline bool chmin(A &a, B b) { if (a>b) { a=b; return 1; } return 0; }
typedef long long ll;
typedef pair<int, int> pii;
const ll INF = 1e9+100;
const ll MOD = 1e9+7;
const bool debug = false;

void solve(string s, vector<string> &str, vector<string> &cont) {
	int p = 0;
	string cur = "";
	while (p < s.size()) {
		if (s[p] == '\"') {
			p++;
			if (cur != "") str.push_back(cur);
			str.push_back("*");

			cur = "";
			while (s[p] != '\"') cur += s[p++];
			cont.push_back(cur);
			cur = "";
			p++;
		}
		else cur += s[p++];
	}
	if (cur != "") str.push_back(cur);
}

int main() {
	string s[2];
	while (cin >> s[0], s[0] != ".") {
		cin >> s[1];
		if (debug) putchar('@');
		if (s[0] == s[1]) puts("IDENTICAL");
		else {
			vector<string> str[2]; // encode
			vector<string> cont[2]; // ""の中身
			solve(s[0], str[0], cont[0]);
			solve(s[1], str[1], cont[1]);
			
			bool ng = false;
			if (str[0].size() != str[1].size()) ng = true;
			else {
				REP(i, str[0].size()) if (str[0][i] != str[1][i]) ng = true;
			}
			if (!ng) {
				int ngcnt = 0;
				REP(i, cont[0].size()) {
					if (cont[0][i] != cont[1][i]) ngcnt++;
				}
				if (ngcnt != 1) ng = true;
			}

			if (ng) puts("DIFFERENT");
			else puts("CLOSE");
		}
	}
	return 0;
}

C++: #include <iostream>
#include <vector>
#include <string>
using namespace std;
int main(int argc, char *argv[])
{
  for(;;) {
    string s, t;
    cin >> s;
    if(s == ".") break;
    cin >> t;
    auto f = [](string &str, vector<string> &ts, vector<string> &ss) {
      int n = str.length();
      for(;;) {
        int j = str.find("\"");
        if(j < 0) break;
        ts.push_back(str.substr(0,j));
        str = str.substr(j+1);
        int k = str.find("\"");
        ss.push_back(str.substr(0, k));
        str = str.substr(k+1);
        //cout << *ts.rbegin() << endl;
        //cout << *ss.rbegin() << endl;
      }
      ts.push_back(str);
      //cout << *ts.rbegin() << endl;
    };
    vector<string> ss1, ts1;
    f(s, ts1, ss1);
    vector<string> ss2, ts2;
    f(t, ts2, ss2);
    if((ss1.size() != ss2.size()) || (ts1.size() != ts2.size())) {
      cout << "DIFFERENT" << endl;
    } else {
      auto g = [](const vector<string> &x1, const vector<string> &x2) {
        int dd = 0;
        for(int i = 0; i < x1.size(); i++) {
          if(x1[i] != x2[i]) dd++;
        }
        return dd;
      };
      int ds = g(ss1, ss2);
      int dt = g(ts1, ts2);
      if(ds == 0 && dt == 0) {
        cout << "IDENTICAL" << endl;
      } else if (ds == 1 && dt == 0){
        cout << "CLOSE" << endl;
      } else {
        cout << "DIFFERENT" << endl;
      }
    }
  }
  return 0;
}

C++: #include <iostream>
#define LENGTH 201
using namespace std;
char str1[LENGTH];
char str2[LENGTH];

int main(){
    while(true){
        int cnt = 0;
        cin >> str1;
        if(str1[0] == '.')
            break;
        cin >> str2;
        for(int i = 0;i <= LENGTH;i++){
            if(str1[i] != str2[i])
                cnt++;
        }
        if(cnt == 0)
            cout << "IDENTICAL" << endl;
        else if(cnt == 1)
            cout << "CLOSE" << endl;
        else
            cout << "DIFFERENT" << endl;
    }

    return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>
using namespace std;

string s[2];

string eraseElements(string s) {
	string ret;
	bool isin = false;
	
	for (int i = 0; i < s.length(); i++) {
		if (s[i] == '"') { isin = !isin; continue; }
		if (!isin) { ret += s[i]; }
	}
	return ret;
}

vector<string> getElements(string s) {
	bool isin = false;
	string tmp;
	vector<string> ret;
	
	for (int i = 0; i < s.length(); i++) {
		if (s[i] == '"') { isin = !isin; }
		if (isin && s[i] != '"') { tmp += s[i]; }
		if (!isin) { ret.push_back(tmp); tmp = ""; }
	}
	return ret;
}

string solve() {
	if (s[0] == s[1]) { return "IDENTICAL"; }
	if (eraseElements(s[0]) != eraseElements(s[1])) { return "DIFFERENT"; }
	
	vector<string> t[2];
	t[0] = getElements(s[0]);
	t[1] = getElements(s[1]);
	
	if (t[0].size() != t[1].size()) { return "DIFFERENT"; }
	
	int cnt = 0;
	for (int i = 0; i < t[0].size(); i++) {
		if (t[0][i] != t[1][i]) {
			cnt++;
		}
	}
	if (cnt == 1) return "CLOSE";
	return "DIFFERENT";
}

int main() {
	while (cin >> s[0]) {
		if (s[0] == ".") break;
		cin >> s[1];
		cout << solve() << endl;
	}
	
	return 0;
}