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 <bitset>
#include <fstream>
#include <string>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <vector>
#include <algorithm>
#include <numeric>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <functional>
#include <cctype>
#include <list>
#include <limits>
#include <unordered_map>
#include <cassert>
//#include <boost/multiprecision/cpp_int.hpp>

const double EPS = (1e-10);


using namespace std;
using Int = long long;
//using namespace boost::multiprecision;

const Int MOD = 998244353;

Int mod_pow(Int x, Int n) {
    Int res = 1;
    while(n > 0) {
        if(n & 1) res = (res * x) % MOD; //ビット演算(最下位ビットが1のとき)
        x = (x * x) % MOD;
        n >>= 1; //右シフト(n = n >> 1)
    }
    return res;
}

//最大公約数
template<typename T>
T gcd(T a, T b) {
    return b != 0 ? gcd(b, a % b) : a;
}

//最小公倍数
template<typename T>
T lcm(T a, T b) {
    return a * b / gcd(a, b);
}

//入出力高速化(非同期化)
void fast_input() {
    cin.tie(0);
    ios::sync_with_stdio(false);
}

int solve(string &s1, string &s2) {
    vector<string> s1str;
    vector<string> s2str;
    vector<string> parsed_s1;
    vector<string> parsed_s2;
    if (s1.length() == s2.length()) {
        for (size_t i = 0; i < s1.length(); i++) {
            if (s1[i] != s2[i]) {
                break;
            }
            if (i == s1.length() -1) {
                return 0;
            }
        }
    }
    string tmp;
    int flag = 0;
    for (size_t i = 0; i < s1.length(); i++) {
        if (s1[i] == '"'){ 
            flag ^= 1;
            if (!flag) {
                if (tmp.length()) s1str.push_back(tmp);
                else s1str.push_back("-1");
                tmp.clear();
            }
            continue;
        }
        if (flag) {
            tmp.push_back(s1[i]);
        }
    }
    s1.push_back('"');
    flag = 1;
    for (size_t i = 0; i < s1.length(); i++) {
        if (s1[i] == '"'){ 
            flag ^= 1;
            if (!flag) {
                if (tmp.length()) parsed_s1.push_back(tmp);
                else parsed_s1.push_back("-1");
                tmp.clear();
            }
            continue;
        }
        if (flag) {
            tmp.push_back(s1[i]);
        }
    }
    flag = 0;
    for (size_t i = 0; i < s2.length(); i++) {
        if (s2[i] == '"'){ 
            flag ^= 1;
            if (!flag) {
                if (tmp.length()) s2str.push_back(tmp);
                else s2str.push_back("-1");
                tmp.clear();
            }
            continue;
        }
        if (flag) {
            tmp.push_back(s2[i]);
        }
    }
    s2.push_back('"');
    flag = 1;
    for (size_t i = 0; i < s2.length(); i++) {
        if (s2[i] == '"'){ 
            flag ^= 1;
            if (!flag) {
                if (tmp.length()) parsed_s2.push_back(tmp);
                else parsed_s2.push_back("-1");
                tmp.clear();
            }
            continue;
        }
        if (flag) {
            tmp.push_back(s2[i]);
        }
    }
    

    int cnt = 0;
    if (s1str.size() == s2str.size()) {
        for (size_t i = 0; i < s1str.size(); i++) {
            if (s1str[i] != s2str[i]) {
                cnt++;
            }
        }
        if (parsed_s1.size() == parsed_s2.size()) {
            for (size_t i = 0; i < parsed_s1.size(); i++) {
                if (parsed_s1[i] != parsed_s2[i]) {
                    cnt = 100;
                }
            }
        }
        if (cnt < 2) return 1; 
    }
    return 2;
}

int main(void) {
    string s1, s2;

    vector<int> ans;
    while (1) {
        cin >> s1;
        if (s1[0] != '.') cin >> s2;
        else break;
        ans.push_back(solve(s1, s2));
    }
    vector<string> ansString = {"IDENTICAL", "CLOSE", "DIFFERENT"};
    for (auto i : ans) {
        cout << ansString[i] << endl;
    }
}

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

int main(){
  string str1,str2;

  while(cin >> str1, str1!="."){
    cin >> str2;
    bool frg = true;
    int er_cnt = 0;
    int j=0;
    int v1_cnt = 0;
    int v2_cnt = 0;
    for(int i=0; i<str1.size(); ++i){
      vector<char> v1;
      vector<char> v2;

      while(str1[i]!= '"' && i<str1.size()){
	v1.push_back(str1[i]);
	++i;
      }
      if(str1[i+1]=='"'){++v1_cnt;}
      
      while(str2[j]!='"' && j<str2.size()){
	v2.push_back(str2[j]);
	++j;
      }
      if(str2[j+1]=='"'){++v2_cnt;}
      ++j;
      
      if(v1!=v2 || v1.size()!=v2.size()){
	if(frg == true){
	  er_cnt = er_cnt+2;
	}else if(frg == false){
	  ++er_cnt;
	}
      }
      if(v1_cnt!=v2_cnt){er_cnt += 2;}

      frg = !frg;
    }

    if(er_cnt == 0){
      cout << "IDENTICAL" << endl;
    }else if(er_cnt == 1){
	cout << "CLOSE" << endl;
      }else{
      cout << "DIFFERENT" << endl;
    }
    
  }
  return 0;
}