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>
#define For(i, a, b) for(int (i)=(int)(a); (i)<(int)(b); ++(i))
#define rFor(i, a, b) for(int (i)=(int)(a)-1; (i)>=(int)(b); --(i))
#define rep(i, n) For((i), 0, (n))
#define rrep(i, n) rFor((i), (n), 0)
#define fi first
#define se second
using namespace std;
typedef long long lint;
typedef unsigned long long ulint;
typedef pair<int, int> pii;
typedef pair<int, lint> pil;
typedef pair<lint, lint> pll;
template<class T> bool chmax(T &a, const T &b){if(a<b){a=b; return true;} return false;}
template<class T> bool chmin(T &a, const T &b){if(a>b){a=b; return true;} return false;}
template<class T> T div_floor(const T a, const T b){return a>=0 ? a/b : (a+1)/b-1;}
template<class T> T div_ceil(const T a, const T b){return a>=0 ? (a-1)/b+1 : a/b;}

constexpr lint mod = 1e9+7;
constexpr lint INF = mod*mod;
constexpr int MAX = 200010;

void f(string &s, vector<string> &a, vector<string> &b){
    int l = 0;
    while(l < s.size()){
        if(s[l] != '"'){
            int r = l;
            string tmp;
            while(r < s.size() && s[r] != '"'){
                tmp += s[r++];
            }
            b.push_back(tmp);
            l = r;
        }
        else {
            string tmp;
            int r = l+1;
            while(s[r] != '"') tmp += s[r++];
            a.push_back(tmp);
            l = r+1;
        }
    }
}

int main(){
    string s, t;
    while(cin >> s && s != "."){
        cin >> t;
        vector<string> sa, ta;
        vector<string> sb, tb;
        f(s, sa, sb);
        f(t, ta, tb);
        /*for(auto &x: sa) cout << x << " ";
        cout << endl;
        for(auto &x: ta) cout << x << " ";
        cout << endl;
        for(auto &x: sb) cout << x << " ";
        cout << endl;
        for(auto &x: tb) cout << x << " ";
        cout << endl;*/
        if(sa.size() != ta.size() || sb.size() != tb.size()) puts("DIFFERENT");
        else{
            bool flag = true;
            rep(i, sb.size()){
                if(sb[i] != tb[i]){
                    puts("DIFFERENT");
                    flag = false;
                    break;
                }
            }
            if(!flag) continue;

            int cnt = 0;
            rep(i, sa.size()) cnt += (sa[i] != ta[i]);
            if(cnt == 0) puts("IDENTICAL");
            else if(cnt == 1) puts("CLOSE");
            else puts("DIFFERENT");
        }
    }
}

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

int main(){

  while(true){
    int wrongTime = 0;
    string str_in;
    string str_ans;
    vector <string> sub_in;
    vector <string> sub_ans;
    //input--------------------
    cin >> str_in;
    if( str_in == ".") break;
    cin>> str_ans;
    //split---------------------
    int start = 0;
    for(int i=0; i < str_in.size() ; i++){
      if(str_in[i] == '\"') {
        sub_in.push_back(str_in.substr(start,i-start));
        start = i+1;
      }
    }
    start = 0;
    for(int i=0; i < str_ans.size() ; i++){
      if(str_ans[i] == '\"') {
        sub_ans.push_back(str_ans.substr(start,i-start));
        start = i+1;
      }
    }

    if(sub_in.size() == 0) sub_in.push_back(str_in);
    if(sub_ans.size() == 0) sub_ans.push_back(str_ans);
    //split check
      // for(int i = 0; i < sub_in.size(); i++) cout << sub_in[i] << endl;
      // for(int i = 0; i < sub_ans.size(); i++) cout << sub_ans[i] << endl;
    //conpare
    if(sub_in.size() != sub_ans.size()){
      wrongTime = 2;
    }else{
      wrongTime = 0;
      for(int i = 0; i < sub_in.size(); i++){
        if(i%2 == 1){
          if(sub_in[i] != sub_ans[i]) wrongTime ++;
        }else{
          if(sub_in[i] != sub_ans[i]) wrongTime += 2;
        }
      }
    }
    if(wrongTime == 0) cout << "IDENTICAL" << endl;
    else if(wrongTime <= 1) cout << "CLOSE" << endl;
    else cout << "DIFFERENT" << endl;
    sub_in.clear();
    sub_ans.clear();
  }

  return 0;
}