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 <algorithm>
#include <functional>
#include <vector>
#include <utility>
#include <cstring>
#include <cmath>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <numeric> 
using namespace std;
typedef long long ll;
const int INF = 1<<30; 
const int MOD = 1e9 + 7;
const int dx[] = {1, 0, -1, 0};
const int dy[] = {0, 1, 0, -1};
int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
    string s, t;
    while(cin >> s)
    {
        if(s == ".") break;
        cin >> t;
        if(s == t)
        {
            cout << "IDENTICAL" << endl;
            continue;
        }
        bool flag = true;
        vector<string> v, w;
        int left, right;
        while((left = s.find('"')) != -1)
        {
            right = s.find('"', left + 1);
            v.push_back(s.substr(left, right - left + 1));
            s.replace(left, right - left + 1, "#");
        }
        while((left = t.find('"')) != -1)
        {
            right = t.find('"', left + 1);
            w.push_back(t.substr(left, right - left + 1));
            t.replace(left, right - left + 1, "#");
        }
        int cnt = 0;
        for(int i = 0; i < min(v.size(), w.size()); i++) if(v[i] != w[i]) cnt++;
        if(cnt < 2 && s == t) cout << "CLOSE" << endl;
        else cout << "DIFFERENT" << endl;
    }
	return 0;
}

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

int main(){
  std::string str1,str2;
  int l1,l2,mistakes,j=0;
  int ok[1000]={0};
  while(str1[0]!='.'){
    mistakes=0;
    std::getline(std::cin,str1);
    l1=str1.size();
    if(str1[0]=='.') break;
    std::getline(std::cin,str2);
    l2=str2.size();
    for(int i=0;i<l1;i++){
      if(str1[i]!=str2[i]){
	mistakes++;
      }
    }
    if(mistakes==0 and l1==l2){
      ok[j]=0;
    }else if(mistakes==1){
      ok[j]=1;
    }else{
      ok[j]=2;
    }
    j++;
  }

  for(int i=0;i<j;i++){
    if(ok[i]==0){
      std::cout<<"IDENTICAL\n";
    }else if(ok[i]==1){
      std::cout<<"CLOSE\n";
    }else{
      std::cout<<"DIFFERENT\n";
    }
  }
}

C++: #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
using namespace std;
int main(){
    while(true){
        string s1,s2;
        cin>>s1;
        if(s1==".")
            break;
        cin>>s2;
        if(s1==s2) 
            cout<<"IDENTICAL"<<endl;
        else{
            vector <string> Vs1;
            vector <string> Vs2;
            vector <string> s1copy;
            vector <string> s2copy;
            for(int i=0;i<s1.size();i++){
                if(s1[i]=='\"'){
                    i++;
                    string s="";
                    while(s1[i]!='\"'){
                        s+=s1[i];
                        i++;
                    }
                    Vs1.push_back(s);
                }else{
                    string s="";
                    while(i<s1.size() && s1[i]!='\"'){
                        s+=s1[i];
                        i++;
                    }
                    i--;
                    s1copy.push_back(s);
                }
            }
            for(int i=0;i<s2.size();i++){
                if(s2[i]=='\"'){
                    i++;
                    string s="";
                    while(s2[i]!='\"'){
                        s+=s2[i];
                        i++;
                    }
                    Vs2.push_back(s);
                }else{
                    string s="";
                    while(i<s2.size() && s2[i]!='\"'){
                        s+=s2[i];
                        i++;
                    }
                    i--;
                    s2copy.push_back(s);
                }
            }
            if(Vs1.size()!=Vs2.size() || s1copy.size()!=s2copy.size()){
                cout<<"DIFFERENT"<<endl;
                continue;
            }
            bool continueflag=false;
            for(int i=0;i<s1copy.size();i++){
                if(s1copy[i]!=s2copy[i]){
                    cout<<"DIFFERENT"<<endl;
                    continueflag=true;
                    break;
                }
            }
            if(continueflag)continue;
            int wrongcount=0;
            for(int i=0;i<Vs1.size();i++){
                if(Vs1[i]!=Vs2[i])
                    wrongcount++;
            }
            if(wrongcount==1){
                cout<<"CLOSE"<<endl;
            }else{
                cout<<"DIFFERENT"<<endl;
            }
        }
    }
    return 0;
}