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 <vector>
#include <algorithm>
#include <map>
#include <string>
#include <queue>
#include <math.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
const ll mod = 1000000007;
ll bit[200010], num;

ll sum(ll i)
{
	ll s = 0;
	while (i > 0)
	{
		s += bit[i];
		i -= i & -i;
	}
	return s;
}

void add(ll i, ll x)
{
	while (i <= num)
	{
		bit[i] += x;
		i += i & -i;
	}
}

ll po(ll x, ll y)
{
	if (y == 0) return 1;
	if (y % 2)
	{
		return po(x, y - 1) * x % mod;
	}
	else
	{
		ll yyy = po(x, y / 2);
		return yyy * yyy % mod;
	}
}

ll div(ll x)
{
	return po(x, mod - 2);
}

int main(void)
{
	while (true)
	{
		string s[2], t[2], c[2][210];
		bool cst = false, all = true;
		cin >> s[0];
		if (s[0][0] == '.' && s[0].length() == 1)
		{
			break;
		}
		cin >> s[1];
		if (s[0].length() == s[1].length())
		{
			for (int i = 0; i < s[0].length(); i++)
			{
				if (s[0][i] != s[1][i])
				{
					all = false;
				}
			}
		}
		else
		{
			all = false;
		}

		if (all)
		{
			cout << "IDENTICAL" << endl;
			continue;
		}
		int o[2] = { -1, -1 };
		for (int i = 0; i < 2; i++)
		{
			for (int j = 0; j < s[i].length(); j++)
			{
				if (s[i][j] == '"' && cst)
				{
					cst = false;
					t[i] += s[i][j];
				}
				else if (s[i][j] == '"')
				{
					cst = true;
					o[i]++;
					t[i] += s[i][j];
				}
				else if (cst)
				{
					c[i][o[i]] += s[i][j];
				}
				else
				{
					t[i] += s[i][j];
				}
			}
		}
		if (t[0].length() != t[1].length())
		{
			cout << "DIFFERENT" << endl;
			continue;
		}
		bool jud = true;
		for (int i = 0; i < t[0].length(); i++)
		{
			if (t[0][i] != t[1][i])
			{
				jud = false;
			}
		}
		int dif = 0;
		for (int i = 0; i <= o[0]; i++)
		{
			if (c[0][i].length() != c[1][i].length())
			{
				dif++;
				continue;
			}
			bool J = true;
			for (int j = 0; j < c[0][i].length(); j++)
			{
				if (c[0][i][j] != c[1][i][j])
				{
					J = false;
				}
			}
			if (!J)
			{
				dif++;
			}
		}

		if (!jud || dif > 1)
		{
			cout << "DIFFERENT" << endl;
			continue;
		}
		if (dif == 1)
		{
			cout << "CLOSE" << endl;
		}
	}
	int www;
	cin >> www;
}

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;
		int cnt3 = 0, cnt4 = 0;
		for (int i = 0; i < S1.size() - 1; i++) {

			if (S1[i] == S1[i + 1] && S1[i] == '"' && cnt3 % 2 == 0) { i++; }
			else {
				if (S1[i] == '"')cnt3++;
				B1 += S1[i];
			}
		}
		for (int i = 0; i < S2.size() - 1; i++) {
			if (S2[i] == S2[i + 1] && S2[i] == '"' && cnt4 % 2 == 0) { i++; }
			else {
				if (S2[i] == '"')cnt4++;
				B2 += S2[i];
			}
		}
		if (S1[S1.size() - 1] != '"' || (S1[S1.size() - 1] == '"' && cnt3 % 2 == 1))B1 += S1[S1.size() - 1];
		if (S2[S2.size() - 1] != '"' || (S2[S2.size() - 1] == '"' && cnt4 % 2 == 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;
}

C++: #include<iostream>
#include<sstream>
#include<string>
using namespace std;
 
int main(){
    while(1){
        string s1,s2;
        cin>>s1;
        if(s1==".")return 0;
        cin>>s2;
        string s11[201],s22[201];
        for(int i=0;i<201;i++){
            s11[i]=".";s22[i]=".";
        }
        s11[0]="";s22[0]="";
        int now1=0,now2=0;
        for(int i=0;i<(int)s1.length();i++){
            if(s1[i]=='"'){
                now1++;
                s11[now1]="";
            }else s11[now1]+=s1[i];
        }
        for(int i=0;i<(int)s2.length();i++){
            if(s2[i]=='"'){
                now2++;
                s22[now2]="";
            }else s22[now2]+=s2[i];
        }
        int d=0;
        for(int i=0;i<201;i++){
            if(s11[i]!=s22[i]){
                if(i&1){
                    d++;
                }else d+=2;
            }
        }
        if(d==0)cout<<"IDENTICAL";
        else if(d==1)cout<<"CLOSE";
        else cout<<"DIFFERENT";
        cout<<"\n";
    }
}