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;

int main() {
    while (true){
  string s1,s2;
  int u=-1,t=0,v=0;
  cin >> s1 >> s2;
  if (s1==".") break;
  vector<string> a(0),b(0);
  string y1="",y2="";
  for (int i=0;i<s1.size();i++){
    if (s1.at(i)=='"') {
      a.push_back("");
      u++;
      i++;
      while (true){
        if (s1.at(i)=='"') break;
        else a.at(u)=a.at(u)+s1.at(i);
        i++;
      }
    }
    y1=y1+s1.at(i);
  }
  u=-1;
  for (int i=0;i<s2.size();i++){
    if (s2.at(i)=='"') {
      b.push_back("");
      u++;
      i++;
      while (true){
        if (s2.at(i)=='"') break;
        else b.at(u)=b.at(u)+s2.at(i);
        i++;
      }
    }
    y2=y2+s2.at(i);
  }
  if (y1!=y2) {cout << "DIFFERENT" << endl;t=1;}
  for (int i=0;i<min(a.size(),b.size());i++){
    if (a.at(i)!=b.at(i)) v++;
  }
  if (v==0 && t==0) cout << "IDENTICAL" << endl;
  if (v==1 && t==0) cout << "CLOSE" << endl;
  if (v>1 && t==0) cout << "DIFFERENT" << endl;
}
}

C++: #include <bits/stdc++.h>
using namespace std;

string getString(vector<string> vec)
{
    string result = "";
    for (int i = 0; i < vec.size(); i++)
    {
        result += vec[i] + ", ";
    }
    return result;
}

int main()
{
    vector<string> ans;

    while (1)
    {
        string in1;
        cin >> in1;
        if (in1 == ".")
        {
            break;
        }
        string in2;
        cin >> in2;

        vector<string> T1, T2;
        vector<string> U1, U2;

        bool InQuote = false;
        for (int i = 0; i < in1.size(); i++)
        {
            if (InQuote)
            {
                T1.push_back("");
                while (in1[i] != '"' && i < in1.size())
                {
                    T1[T1.size() - 1] += in1[i];
                    i++;
                }
                InQuote = false;
            }
            else
            {
                T2.push_back("");
                while (in1[i] != '"' && i < in1.size())
                {
                    T2[T2.size() - 1] += in1[i];
                    i++;
                }
                InQuote = true;
            }
        }
        InQuote = false;
        for (int i = 0; i < in2.size(); i++)
        {
            if (InQuote)
            {
                U1.push_back("");
                while (in2[i] != '"' && i < in2.size())
                {
                    U1[U1.size() - 1] += in2[i];
                    i++;
                }
                InQuote = false;
            }
            else
            {
                U2.push_back("");
                while (in2[i] != '"' && i < in2.size())
                {
                    U2[U2.size() - 1] += in2[i];
                    i++;
                }
                InQuote = true;
            }
        }

        // ans.push_back(getString(T1));
        // ans.push_back(getString(T2));
        // ans.push_back(getString(U1));
        // ans.push_back(getString(U2));

        if (T1.size() != U1.size() || T2.size() != U2.size())
        {
            ans.push_back("DIFFERENT");
        }
        else
        {
            bool ok = true;
            for (int i = 0; i < T2.size(); i++)
            {
                if (T2[i] != U2[i])
                {
                    ans.push_back("DIFFERENT");
                    ok = false;
                    break;
                }
            }
            if (ok)
            {
                int NumMiss = 0;
                for (int i = 0; i < T1.size(); i++)
                {
                    NumMiss += (T1[i] != U1[i] ? 1 : 0);
                }
                if (NumMiss >= 2)
                {
                    ans.push_back("DIFFERENT");
                }
                else if (NumMiss == 1)
                {
                    ans.push_back("CLOSE");
                }
                else if (NumMiss == 0)
                {
                    ans.push_back("IDENTICAL");
                }
            }
        }
    }

    for (int i = 0; i < ans.size(); i++)
    {
        cout << ans[i] << endl;
    }
}

C++: #include<stdio.h>
#include<string.h>
#include<string>
char s1[600];
char s2[600];
int main()
{
	while(scanf("%s %s",s1,s2)!=EOF)
	{
		if(strlen(s1)==1&&s1[0]=='.')break;
		int len1=strlen(s1);
		int len2=strlen(s2);
		int sign=0,used=0,close=0,dif=0;
		int t1=0,t2=0;
		while(t1<len1&&t2<len2)
		{
			if(s1[t1]!=s2[t2])
			{
				if(sign)
				{
					sign=0;
					close=1;
					while(s1[t1]!='"'&&t1<len1){t1++;}
					while(s2[t2]!='"'&&t2<len2){t2++;}
				}
				else
				{
					dif=1;
					break;
				}
			}
			else
			{
				if(s1[t1]=='"'&&sign==0&&used==0) sign=1;
				else if(s1[t1]=='"'&&sign==1&&used==0) sign=0;
				t1++;t2++;
			}
		}
		if(t1<len1||t2<len2)dif=1;
		if(dif)printf("DIFFERENT\n");
		else
		{
			if(close)printf("CLOSE\n");
			else printf("IDENTICAL\n");
		}
		
		memset(s1,0,sizeof(s1));
		memset(s2,0,sizeof(s2));
	}
}