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>

int wrong_count(char a1[],char a2[]){
    //std::cout << a1 << ' ' << a2 << '\n';
    int i=0;
    if(a1[i] == '\0' && a2[i] == '\0') return 0;
    do{
        if(a1[i] == a2[i]){
            i++;
            if(a1[i] == '\0' && a2[i] == '\0') return 0;
        }else{
            //std::cout << "return\n";
            return 1;
        }
    }while(a1[i] != '\0' || a2[i] != '\0');
    return 1;
}

void cut_str(char s[],char a[],int& i){
    int ap=0;
    i++;
    while(s[i] != '"'){
        a[ap++] = s[i++];
    }
    i++;
    a[ap] = '\0';
    //std::cout << a << '\n';
}

int compare_str(char s1[],char s2[]){
    int i=0,j=0;
    int count = 0;
    while(s1[i] != '\0' || s2[j] != '\0'){
        if(s1[i] != s2[j]){ return -1; }
        else if(s1[i] == '"' && s2[j] =='"'){
            char a1[200] = {},a2[200] = {};
            cut_str(s1,a1,i);
            cut_str(s2,a2,j);
            count += wrong_count(a1,a2);
            if(count > 1) return -1;
            if(s1[i] == '\0' && s2[j] == '\0') return count;
        }else{
            i++;
            j++;
            if(s1[i] == '\0' && s2[j] == '\0') return count;
        }
    }
    return count;
}


int main(){
  char s1[200]= {},s2[200] = {} ;
  for(int i=0;i<100;i++){
      std::cin >> s1 ;
      if(s1[0] == '.') break;
      std::cin >> s2;
      int count = compare_str(s1,s2);
    if(count == 0){
      std::cout << "IDENTICAL\n";
    }else if(count == 1){
      std::cout << "CLOSE\n";
    }else{
      std::cout << "DIFFERENT\n";
    }
  }
  return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
const double eps = 1e-10;
const int MOD = 1000000007;
const int INF = 1000000000;
const ll LINF = 1ll<<50;
template<typename T>
void printv(const vector<T>& s) {
  for(int i=0;i<(int)(s.size());++i) {
    cout << s[i];
    if(i == (int)(s.size())-1) cout << endl;
    else cout << " ";
  }
}
int main() {
  cin.tie(0);
  cout << fixed << setprecision(10);
  while(1) {
    string s1; cin >> s1;
    if(s1 == ".") break;
    string s2; cin >> s2;
    vector<string> v1, v2;
    vector<string> c1, c2;
    vector<string> p1, p2;
    int pos = 0;
    bool odd = false;
    for(int i=0;i<(int)(s1.size());++i) {
      if(s1[i] == '"') {
        if(odd) {
          v1.push_back(s1.substr(pos+1, i - pos - 1));
          c1.push_back(s1.substr(pos+1, i - pos - 1));
          odd = false;
        } else {
          pos = i;
          odd = true;
        }
      } else if(!odd) {
        v1.push_back(s1.substr(i, 1));
        p1.push_back(s1.substr(i, 1));
      }
    }
    for(int i=0;i<(int)(s2.size());++i) {
      if(s2[i] == '"') {
        if(odd) {
          v2.push_back(s2.substr(pos+1, i - pos - 1));
          c2.push_back(s2.substr(pos+1, i - pos - 1));
          odd = false;
        } else {
          pos = i;
          odd = true;
        }
      } else if(!odd) {
        v2.push_back(s2.substr(i, 1));
        p2.push_back(s2.substr(i, 1));
      }
    }
    if((int)(v1.size()) != (int)(v2.size()) || (int)(c1.size()) != (int)(c2.size()) || (int)(p1.size()) != (int)(p2.size())) {
      cout << "DIFFERENT" << endl;
      continue;
    }
    int cnt1 = 0;
    for(int i=0;i<(int)(v1.size());++i) {
      if(v1[i] != v2[i]) cnt1++;
    }
    int cnt2 = 0;
    for(int i=0;i<(int)(p1.size());++i) {
      if(p1[i] != p2[i]) cnt2++;
    }
    int cnt3 = 0;
    for(int i=0;i<(int)(c1.size());++i) {
      if(c1[i] != c2[i]) cnt3++;
    }
    if(cnt2 != 0 || cnt3 > 1 || cnt1 != cnt2 + cnt3) {
      cout << "DIFFERENT" << endl;
    } else if(cnt3 == 0) {
      cout << "IDENTICAL" << endl;
    } else if(cnt3 == 1) {
      cout << "CLOSE" << endl;
    } else {
      cout << "DIFFERENT" << endl;
    }
  }
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <regex>
using namespace std;

vector<string> split(const string &s, regex delim) {
    vector<string> res;
    sregex_token_iterator itr(s.begin(), s.end(), delim, -1), end;
    for(; itr!=end; itr++){
        /*if(*itr != "")*/ res.push_back(*itr);
    }
    return res;
}

int main(){
    while(1){
        vector<string> a(2);
        cin >> a[0];
        if(a[0]==".") break;
        cin >> a[1];

        vector<vector<string> > b(2);
        for(int i=0; i<2; i++){
            b[i] = split(a[i], regex{R"(")"});
        }
        if(b[0].size() != b[1].size()){
            cout << "DIFFERENT" << endl;
        }else{
            vector<int> dif(2, 0);
            for(int i=0; i<(int)b[0].size(); i++){
                if(b[0][i] != b[1][i]) dif[i%2]++;
            }
            if(dif[0]==0 && dif[1]==0){
                cout << "IDENTICAL" << endl;
            }else if(dif[0]==0 && dif[1]==1){
                cout << "CLOSE" << endl;
            }else{
                cout << "DIFFERENT" << endl;
            }
        }
    }
    return 0;
}