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;
typedef long long ll;
typedef pair<int,int> P;

bool check(string s1,string s2){
	int l=0,r=0;
	bool flag=false;
	int cnt=0;
	while(l<s1.size() || r<s2.size()){
		if(s1.size()==l || s2.size()==r)return false;
		if(s1[l]!=s2[r])return false;
		if(s1[l]=='"'){
			l++;
			string ss="";
			while(s1[l]!='"'){
				ss+=s1[l];
				l++;
			}
			l++;
			r++;
			string ss2="";
			while(s2[r]!='"'){
				ss2+=s2[r];
				r++;
			}
			r++;
			if(ss!=ss2){
				cnt++;
			}
		}else{
			l++;
			r++;
		}
	}
	return (l==s1.size() && r==s2.size() && cnt<=1);
}

int main(void){
	while(1){
		string s1,s2;
		cin >> s1;
		if(s1==".")break;
		cin >> s2;
		if(s1==s2){
			printf("IDENTICAL\n");
		}else{
			printf("%s\n",check(s1,s2)?"CLOSE":"DIFFERENT");
		}
	}
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for (int i = a; i < b; i++)
#define REP(i,b) FOR(i,0,b)
#define RFOR(i,a,b) for (int i = a-1; i >= b; i--)
#define RREP(i,a) RFOR(i,a,0)
#define REPALL(i,v) for (int i = 0; i < v.size(); i++)
#define RREPALL(i,v) for (int i = v.size()-1; i >= 0; i--)
#define SORT(v) sort(v.begin(), v.end())
#define MIN_ELEMENT(v) min_element(v.begin(), v.end())
#define MAX_ELEMENT(v) max_element(v.begin(), v.end())
#define COUNT(v,n) count(v.begin(), v.end(), n);
void YES(bool flag) {cout<<(flag ? "YES" : "NO")<<endl;}
void Yes(bool flag) {cout<<(flag ? "Yes" : "No")<<endl;}
void yes(bool flag) {cout<<(flag ? "yes" : "no")<<endl;}
typedef long long ll;
typedef unsigned long long ull;
const int INF = 1e7;
const ll MOD = 1e9 + 7;

string s1, s2;
vector<string> ans;
vector<string> o1, o2, e1, e2;

bool close()
{
    o1.clear(); o2.clear(); e1.clear(); e2.clear();
    bool tflag = true;
    string tmp;
    REPALL(i,s1) {
        if (s1[i] == '\"' || i == s1.size() - 1) {
            if (tflag) {
                o1.push_back(tmp);
            } else {
                e1.push_back(tmp);
            }
            tflag = !tflag;
            tmp.clear();
        } else {
            tmp += s1[i];
        }
    }
    tflag = true;
    REPALL(i,s2) {
        if (s2[i] == '\"' || i == s2.size() - 1) {
            if (tflag) {
                o2.push_back(tmp);
            } else {
                e2.push_back(tmp);
            }
            tflag = !tflag;
            tmp.clear();
        } else {
            tmp += s2[i];
        }
    }

    if (o1.size() != o2.size()) {
        return false;
    } else {
        REP(i,o1.size()) {
            if (o1[i] != o2[i])
                return false;
        }
    }

    if (e1.size() != e2.size()) {
        return false;
    } else {
        int cnt = 0;
        REP(i,e1.size()) {
            if (e1[i] != e2[i])
                cnt++;
        }
        return cnt <= 1;
    }
}

int main()
{
    while (cin>>s1, s1 != ".") {
        cin>>s2;
        //s1 = "read\"B1input\";solve;output;";
        //s2 = "read\"B2\";solve;output;";
        if (s1 == s2)
            ans.push_back("IDENTICAL");
        else if (close())
            ans.push_back("CLOSE");
        else
            ans.push_back("DIFFERENT");
    }
    REPALL(i,ans) cout<<ans[i]<<endl;
}

C++: #include <cmath>
#include <iostream>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <utility>
#include <iomanip>

#define int long long int
#define rep(i, n) for(int i = 0; i < (n); ++i)

using namespace std;

typedef pair<int, int> P;

const int INF = 1e15;
const int MOD = 1e9+7;

signed main(){
    string s;
    cin >> s;
    while(s != "."){
        string t;
        cin >> t;

        if(s == t){
            cout << "IDENTICAL" << endl;
            cin >> s;
            continue;
        }

        vector<string> xs;
        vector<string> xt;
        int i = 0;
        while(i < (int)s.length()){
            string tmp;
            if(s[i] == '\"'){
                i++;
                tmp = "";
                while(s[i] != '\"'){
                    tmp.push_back(s[i]);
                    i++;
                }
                i++;
                xs.push_back(tmp);
                continue;
            }

            tmp = "";
            while(s[i] != '\"' && i < (int)s.length()){
                tmp.push_back(s[i++]);
            }
            xt.push_back(tmp);
        }

        vector<string> ys;
        vector<string> yt;
        i = 0;
        while(i < (int)t.length()){
            string tmp;
            if(t[i] == '\"'){
                i++;
                tmp = "";
                while(t[i] != '\"'){
                    tmp.push_back(t[i]);
                    i++;
                }
                i++;
                ys.push_back(tmp);
                continue;
            }

            tmp = "";
            while(t[i] != '\"' && i < (int)t.length()){
                tmp.push_back(t[i++]);
            }
            yt.push_back(tmp);
        }

        if(xs.size() != ys.size() || xt.size() != yt.size()){
            cout << "DIFFERENT" << endl;
            cin >> s;
            continue;
        }

        int c = 0;
        rep(i, (int)xs.size()){
            if(xs[i] != ys[i]){
                c++;
            }
        }

        int d = 0;
        rep(i, (int)xt.size()){
            if(xt[i] != yt[i]){
                d++;
            }
        }

        if(d == 0 && c == 1){
            cout << "CLOSE" << endl;
            cin >> s;
            continue;
        }
        cout << "DIFFERENT" << endl;

        cin >> s;
    }

    return 0;
}