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 dx[] = {-1, 1, 0, 0};
int dy[] = {0, 0, -1, 1};
const int INF = 100000;
typedef pair<int, int> P;
int n;
int main()
{
    string s, t;
    while (1)
    {
        vector<int> a, b;
        cin >> s >> t;
        if (s == ".")
            return 0;
        if (s == t)
        {
            cout << "IDENTICAL" << endl;
        }
        else
        {
            a.push_back(0);
            b.push_back(0);
            for (int i = 0; i < s.size(); i++)
            {
                if (s[i] == '"')
                {
                    a.push_back(i);
                }
            }
            for (int i = 0; i < t.size(); i++)
            {
                if (t[i] == '"')
                {
                    b.push_back(i);
                }
            }
            if (a.size() != b.size())
            {
                cout << "DIFFERENT" << endl;
            }
            else
            {
                int cnt = 0;
                for (int i = 1; i < a.size() - 1; i += 2)
                {
                    int x = a[i + 1] - a[i] + 1;
                    int y = b[i + 1] - b[i] + 1;
                    if (s.substr(a[i], x) != t.substr(b[i], y))
                    {
                        cnt++;
                    }
                }
                string u;
                if (cnt == 1)
                {
                    u = "CLOSE";
                }
                cnt = 0;
                a.push_back(s.size() - 1);
                b.push_back(t.size() - 1);
                for (int i = 0; i < a.size() - 1; i++)
                {
                    int x = a[i + 1] - a[i] + 1;
                    int y = b[i + 1] - b[i] + 1;
                    if (s.substr(a[i], x) != t.substr(b[i], y))
                    {
                        cnt++;
                    }
                }
                if (cnt >= 2)
                {
                    u = "DIFFERENT";
                }
                if (u == "")
                    u ="DIFFERENT";
                cout << u << endl;
            }
        }
    }
}

C++: #include<iostream>
#include<sstream>
#include<string>
 
int main(){
    while(1){
      std::string str1,str2;
      std::cin>>str1;
      if(str1==".") break;
      std::cin>>str2;
      std::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;
      int l1,l2;
      l1=str1.size();
      l2=str2.size();
      for(int i=0;i<l1;i++){
	if(str1[i]=='"'){
	  now1++;
	  s11[now1]="";
	}else s11[now1]+=str1[i];
      }
      for(int i=0;i<l2;i++){
	if(str2[i]=='"'){
	  now2++;
	  s22[now2]="";
	}else s22[now2]+=str2[i];
      }
      int mistake=0;
      for(int i=0;i<201;i++){
	if(s11[i]!=s22[i]){
	  if(i&1){
	    mistake++;
	  }else mistake+=2;
	}
      }
      if(mistake==0){
	std::cout<<"IDENTICAL";
      }else if(mistake==1){
	std::cout<<"CLOSE";
      }else{
	std::cout<<"DIFFERENT";
      }
      std::cout<<"\n";
    }
}

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

signed
main(){
		while(1)
		{
				string a,b;
				cin >> a;
				if(a == ".") break;
				cin >> b;
				
				int err_cnt = 0;
				vector<string> st_a, st_b;
				vector<string> oth_a, oth_b;

				int oa_cnt = 0,ob_cnt = 0;
				oth_a.push_back("");
				oth_b.push_back("");

				int st = 0, num = 0;
				bool flag = false;
				for(int i=0;i<a.size();i++)
				{
						if(flag){
								if(a[i]=='\"'){
										num++;
										st_a.push_back(a.substr(st,num));
										oth_a.push_back("");
										oa_cnt++;
										flag = false;
								}else{
										num++;
								}
						}else{
								if(a[i]=='\"'){
										st = i;
										flag = true;
										num = 1;

								}else{
										oth_a[oa_cnt] += a[i];
								}
						}
						
				}
				
				st = 0, num = 0;
				flag = false;
				for(int i=0;i<b.size();i++)
				{
						if(flag){
								if(b[i]=='\"'){
										num++;
										st_b.push_back(b.substr(st,num));
										oth_b.push_back("");
										ob_cnt++;
										flag = false;
								}else{
										num++;
								}
						}else{
								if(b[i]=='\"'){
										st = i;
										flag = true;
										num = 1;

								}else{
										oth_b[ob_cnt] += b[i];
								}
						}
	
				}
				
				int cnm_fcnt = 0;
				if(st_a.size()==st_b.size()){
						for(int i=0;i<st_a.size();i++)
						{
								if(st_a[i]!=st_b[i]) cnm_fcnt++;
						}
				}
				bool oth_flag = true;
				if(oth_a.size()!=oth_b.size()){
						oth_flag =false;
				}else{
						for(int i=0;i<oth_a.size();i++)
						{
								if(oth_a[i]!=oth_b[i]){
									oth_flag =false;
								}
						}
				}


				if(a==b){
						cout << "IDENTICAL" << endl;
				}else if(oth_flag && cnm_fcnt == 1){
						cout << "CLOSE" << endl;
				}else{
						cout << "DIFFERENT" << endl;
				}
		}
}