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>
#include<vector>

using namespace std;

int main(){
	while(1){
		string s1,s2;
		cin >> s1;
		if(s1 == ".") break;
		cin >> s2;
		vector<string> moji1,moji2,code1,code2;
		
		int last = 0;
		int dq = 0;
		for(int i = 0;i < s1.size();i++){
			if(s1[i] == '"'){
				dq++;
				if(i != 0){
					if(dq % 2 == 1){
						if(dq == 1){
							code1.push_back(s1.substr(0,i-1));
						}else{
							code1.push_back(s1.substr(last+1,i-last-1));
						}
					}else{
						moji1.push_back(s1.substr(last+1,(i-last-1)));
					}
				}
				last = i;
			}
		}
		if(dq == 0){
			code1.push_back(s1);
		}else if(s1[s1.size()-1]!= '"'){
			code1.push_back(s1.substr(last,s1.size()-last-1));
		}
		
		last = 0;
		dq = 0;
		for(int i = 0;i < s2.size();i++){
			if(s2[i] == '"'){
				dq++;
				if(i != 0){
					if(dq % 2 == 1){
						if(dq == 1){
							code2.push_back(s2.substr(0,i-1));
						}else{
							code2.push_back(s2.substr(last+1,i-last-1));
						}
					}else{
						moji2.push_back(s2.substr(last+1,(i-last-1)));
					}
				}
				last = i;
			}
		}
		if(dq == 0){
			code2.push_back(s2);
		}else if(s2[s2.size()-1]!= '"'){
			code2.push_back(s2.substr(last,s2.size()-last-1));
		}
		
		int cdif = 0;
		if(code1.size() == code2.size()){
			for(int i = 0;i < code1.size();i++){
				if(code1[i]!=code2[i]) cdif++;
			}
		}else{
			cdif = 1;
		}
		int mdif = 0;
		if(moji1.size() == moji2.size()){
			for(int i = 0;i < moji1.size();i++){
				if(moji1[i]!=moji2[i]) mdif++;
			}
		}else{
			mdif = 2;
		}
		if(cdif == 0){
			if(mdif == 0){
				cout << "IDENTICAL" << endl;
			}else if(mdif == 1){
				cout << "CLOSE" << endl;
			}else{
				cout << "DIFFERENT" << endl;
			}
		}else{
			cout << "DIFFERENT" << endl;
		}
	}
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
template <typename T> using V = vector<T>;

using VS = vector<string>;

pair<VS, VS> parse(const string &S) {
    VS num, str;
    bool in_quot = false;
    bool init = true;
    string now = "";
    for(char c : S) {
        if(c == ';' && !in_quot) {
            num.push_back(move(now));
            now = "";
            continue;
        }
        if(c == '"') {
            if(!init) {
                auto &se = (in_quot ? str : num);
                se.push_back(move(now));
                now = "";
            }
            in_quot = !in_quot;
        } else {
            now += c;
        }
        init = false;
    }
    if(now.size()) num.push_back(now);
    return move(make_pair(num, str));
}

ll check(const VS &s, const VS &t) {
    if(s.size() != t.size()) return -1;
    ll cnt = 0;
    for(ll i = 0; i < s.size(); i++) if(s[i] != t[i]) cnt++;
    if(cnt == 0) return 1;
    else if(cnt == 1) return 0;
    else return -1;
}

bool solve() {
    string S;
    cin >> S;
    if(S == ".") return false;
    string T;
    cin >> T;

    VS snum, sstr, tnum, tstr;
    tie(snum, sstr) = parse(S);
    tie(tnum, tstr) = parse(T);

    ll cnum = check(snum, tnum);
    ll cstr = check(sstr, tstr);

    if(cnum == 1 && cstr == 1) cout << "IDENTICAL";
    else if(cnum == 1 && cstr == 0) cout << "CLOSE";
    else cout << "DIFFERENT";
    cout << endl;
    return true;
}

int main() {
    while(solve());
    return 0;
}

C++: #include<iostream>
#include<string>

using namespace std;
typedef long long ll;

int main() {
	
	while (1) {
		string S1, S2;
		cin >> S1;
		if (S1 == ".")break;
		cin >> S2;
		//すでに完全に一致ならば
		if (S1 == S2) {
			cout << "IDENTICAL" << endl;
			continue;
		}
		//""をいずれかが含んでない場合
		int cnt1 = 0, cnt2 = 0;
		for (int i = 0; i < S1.size(); i++) {
			if (S1[i] == '"')cnt1++;
		}
		for (int i = 0; i < S2.size(); i++) {
			if (S2[i] == '"')cnt2++;
		}
		//この時、修正のやりようがないのでDIFFERENT
		if (!(cnt1 * cnt2)) {
			cout << "DIFFERENT" << endl;
			continue;
		}
		//""を圧縮する

		string B1, B2;
		for (int i = 0; i < S1.size() - 1; i++) {

			if (S1[i] == S1[i + 1] && S1[i] == '"') {}
			else  B1 += S1[i];
		}
		for (int i = 0; i < S2.size() - 1; i++) {
			if (S2[i] == S2[i + 1] && S2[i] == '"') {}
			else  B2 += S2[i];
		}
		if (S1[S1.size() - 1] != '"')B1 += S1[S1.size() - 1];
		if (S2[S2.size() - 1] != '"')B2 += S2[S2.size() - 1];
		S1 = B1, S2 = B2;

		//どちらにも""が含まれており、その中でさらに一つがすべて""である場合のフラグ
		bool f3 = false, f4 = false;
		//どちらも""が含まれてる場合
		string buf1, buf2;
		bool f2 = false;//""内にあるかどうかのフラグ
		cnt1 = 0, cnt2 = 0;//""の出現回数
		int pos1 = -1, pos2 = -1;//最初の"の場所
		for (int i = 0; i < S1.size(); i++) {
			if (!f2 && S1[i] == '"') {
				if (cnt1 == 0)pos1 = i;
				cnt1++;
				f2 = !f2;
				continue;
			}
			else if (f2 && S1[i] == '"') {
				cnt1++;
				f2 = !f2;
				continue;
			}
			if (!f2 || cnt1 >= 2) {
				buf1 += S1[i];

			}

		}
		f2 = false;
		for (int i = 0; i < S2.size(); i++) {
			if (!f2 && S2[i] == '"') {
				if (cnt2 == 0)pos2 = i;
				f2 = !f2;
				cnt2++;
				continue;
			}
			else if (f2 && S2[i] == '"') {
				cnt2++;
				f2 = !f2;
				continue;
			}

			if (!f2 || cnt2 >= 2)buf2 += S2[i];

		}

		if (buf1 == buf2 && (pos1 == pos2 || (pos1 == -1 && pos2 != -1) || (pos1 != -1 && pos2 == -1))) {
			cout << "CLOSE" << endl;
		}
		else cout << "DIFFERENT" << endl;

	}

	return 0;
}