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 <algorithm>
#include <iomanip>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <cmath>

static const int MOD = 1000000007;
using ll = long long;
using u32 = uint32_t;
using namespace std;

template<class T> constexpr T INF = ::numeric_limits<T>::max() / 32 * 15 + 208;

int main() {
    string s, t;
    while(getline(cin, s), s != "."){
        getline(cin, t);
        int cnt = 0, offset = 0;
        if(s == t){
            puts("IDENTICAL");
            continue;
        }
        for (int i = 0; i < s.size(); ++i) {
            if(i+offset >= t.size()){
                cnt = 114514;
                break;
            }
            if(s[i] != t[i+offset]){
                cnt = 114514;
                break;
            }
            if(s[i] == '"'){
                string a, b;
                int y = i+1, z = i+offset+1;
                while(s[y] != '"') a += s[y++];
                while(t[z] != '"') b += t[z++];
                offset += z-y-offset;
                i = y;
                if(a != b && (!a.empty() || !b.empty())){
                    cnt++;
                }
            }
        }
        if(cnt == 1 && s.size()+offset == t.size()){
            puts("CLOSE");
        }else {
            puts("DIFFERENT");
        }
    }
    return 0;
}

C++: #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define INF (1<<30)
#define INFLL (1ll<<60)
typedef pair<int, int> P;
typedef pair<int, P> E;
#define MOD (1000000007ll)
#define l_ength size

void mul_mod(ll& a, ll b){
	a *= b;
	a %= MOD;
}

void add_mod(ll& a, ll b){
	b += MOD;
	a += b;
	a %= MOD;
}

int main(void){
	int l[2],r[2],c,i,j;
	bool flag;
	string s[2];
	while(true){
		cin >> s[0];
		if(s[0]=="."){
			break;
		}
		cin >> s[1];
		if(s[0] == s[1]){
			cout << "IDENTICAL" << endl;
			continue;
		}
		c = 0;
		for(i=0; i<2; ++i){
			l[i] = 0;
			r[i] = s[i].l_ength()-1;
		}
		while(s[0][l[0]] == s[1][l[1]]){
			if(s[0][l[0]] == '\"'){
				++c;
			}
			++l[0]; ++l[1];
		}
		if(!(c%2)){
			cout << "DIFFERENT" << endl;
			continue;
		}
		while(s[0][r[0]] == s[1][r[1]]){
			--r[0]; --r[1];
		}
		flag = true;
		for(i=0; i<2; ++i){
			for(j=l[i]; j<=r[i]; ++j){
				if(s[i][j] == '\"'){
					flag = false;
					break;
				}
			}
			if(!flag){
				break;
			}
		}
		cout << ((flag)?"CLOSE":"DIFFERENT") << endl;
	}
	return 0;
}

C++: 
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vd = vector<double>;
using vvd = vector<vd>;
using vl = vector<ll>;
using vvl = vector<vl>;
using pii = pair<int, int>;
using vs = vector<string>;
#define rep(i,n) range(i,0,n)
#define range(i,a,n) for(int i=a;i<n;i++)
#define LINF ((ll)1ll<<60)
#define INF ((int)1<<30)
#define EPS (1e-9)
#define MOD (1000000007)
#define fcout(a) cout<<setprecision(a)<<fixed
#define fs first
#define sc second
#define PI 3.141592653589793

template<class S, class T>ostream&operator<<(ostream&os, pair<S, T>p)
{
	os << "[" << p.first << "," << p.second << "]"; return os;
}
template<class S>auto&operator<<(ostream&os, vector<S>t)
{
	bool a = 1; for (auto s : t) { os << (a ? "" : " ") << s; a = 0; }
	return os;
}

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	string s1, s2;
	while (cin >> s1, s1!="." ) {
		cin >> s2;
		vector<pair<string, int>> tok1(1);
		vector<pair<string, int>> tok2(1);
		int inner = 0;
		for (auto c : s1) {
			if (c == '"') {
				if (inner == 0) {
					inner = 1;
				}
				else {
					inner = 0;
				}
				tok1.emplace_back("", inner);
			}
			else {
				tok1.back().first += c;
			}
		}
		inner = 0;
		for (auto c : s2) {
			if (c == '"') {
				if (inner == 0) {
					inner = 1;
				}
				else {
					inner = 0;
				}
				tok2.emplace_back("", inner);
			}
			else {
				tok2.back().first += c;
			}
		}
		int ans = 0;
		if (tok1.size() == tok2.size()) {
			int diff = 0;
			rep(i, tok1.size()) {
				if (tok1[i].sc != tok2[i].sc) {
					ans = 2; break;
				}
				else {
					if (tok1[i].sc == 0) {
						if (tok1[i].fs != tok2[i].fs) {
							ans = 2;
							break;
						}
					}
					else {
						if (tok1[i].fs != tok2[i].fs) {
							ans++;
						}
					}
				}
			}
		}
		else {
			ans = 2;
		}
		if (ans == 0)cout << "IDENTICAL" << endl;
		else if (ans == 1)cout << "CLOSE" << endl;
		else cout << "DIFFERENT" << endl;
	}
	return 0;
}

C++: #include <stdio.h>
#include <string.h>

int main(void) {
	char str1[201], str2[201];
	bool flag;
	int i, j, count;

	while(1) {
		scanf("%s", str1);
		if(str1[0] == '.' && str1[1] == '\0') break;
		scanf("%s", str2);

		if(strcmp(str1, str2) == 0){
			printf("IDENTICAL\n");
			continue;
		}

		flag = false;
		i = j = count = 0; 
		while(str1[i] != '\0' || str2[j] != '\0') {
			if(str1[i] != str2[j]) {
				if(flag == false) {
					count = 2;
					break;
				} else{
					if(++count >= 2) break;
					flag = false;
					while(str1[i] != '"') i++;
					while(str2[j] != '"') j++;
				}
			} else if(str1[i] == '"' && str2[j] == '"') {
				flag = !flag;
			}
			i++; j++;
		}//endwhile

		if(count == 1){
			printf("CLOSE\n");
		} else{
			printf("DIFFERENT\n");
		}

	}//endwhile
	return 0;
}