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 pb push_back
using namespace std;

pair<vector<string>, vector<string>> extract(string s1) {
    vector<string> command1, str1;
    bool is_command = true;
    string s= "";
    for (char c : s1) {
        if (c == '"') {
            if (is_command) command1.pb(s);
            else str1.pb(s);
            s = "";
            is_command = !is_command;
            continue;
        }
        s += c;
    }
    if (is_command) command1.pb(s);
    else str1.pb(s);
    return make_pair(command1, str1);
}

int solve(string s1, string s2) {
    pair<vector<string>, vector<string>> verb1 = extract(s1);
    pair<vector<string>, vector<string>> verb2 = extract(s2);

    auto command1 = verb1.first;
    auto str1 = verb1.second;

    auto command2 = verb2.first;
    auto str2 = verb2.second;

    if (command1.size() != command2.size() && str1.size() != str2.size()) return 0;

    for (int i = 0; i < command1.size(); i++) {
        if (command1[i] != command2[i]) return 0;
    }

    int count = 0;
    for (int i = 0; i < str1.size(); i++) {
        if (str1[i] != str2[i]) count++;
    }

    if (count == 0) return 1;
    else if (count == 1) return 2;
    else return 0;
}

int main() {
    cin.tie(0);
    while (1) {
        string s1, s2;
        cin >> s1;
        if (s1 == ".") break;
        cin >> s2;
        int ans = solve(s1, s2);
        if (ans == 1) cout << "IDENTICAL" << endl;
        else if (ans == 0) cout << "DIFFERENT" << endl;
        else if (ans == 2) cout << "CLOSE" << endl;
    }
    return 0;
}

C++: #include <bits/stdc++.h> 

using namespace std;
using ll=long long;
using ull=unsigned long long;
using pii=pair<int,int>;

#define INF LONG_MAX
#define MOD 1000000007
#define rng(a) a.begin(),a.end()
#define rrng(a) a.end(),a.begin()

int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);

  while(true){
    string s1,s2;
    cin>>s1;
    if(s1==".")return 0;
    cin>>s2;
    bool flg=(s1==s2);
    vector<string>S1,S2;
    vector<string>S1_,S2_;
    for(int i=0;i<s1.size();i++){
      if(s1[i]=='\"'){
        string memo;
        i++;
        for(;i<s1.size();i++){
          if(s1[i]=='\"')break;
          memo.push_back(s1[i]);
        }
        S1.push_back(memo);
      }
      else{
        string memo;
        for(;i<s1.size();i++){
          if(s1[i]=='\"'){
            i--;
            break;
          }
          memo.push_back(s1[i]);
        }
        S1_.push_back(memo);
      }
    }
    for(int i=0;i<s2.size();i++){
      if(s2[i]=='\"'){
        string memo;
        i++;
        for(;i<s2.size();i++){
          if(s2[i]=='\"')break;
          memo.push_back(s2[i]);
        }
        S2.push_back(memo);
      }
      else{
        string memo;
        for(;i<s2.size();i++){
          if(s2[i]=='\"'){
            i--;
            break;
          }
          memo.push_back(s2[i]);
        }
        S2_.push_back(memo);
      }
    }
    int diff=0;
    bool d=false;
    if(S1.size()!=S2.size())d=true;
    for(int i=0;i<min(S1.size(),S2.size());i++)if(S1[i]!=S2[i])diff++;
    for(int i=0;i<min(S1_.size(),S2_.size());i++)if(S1_[i]!=S2_[i])d=true;
    /*
    cout<<"WORDS"<<endl;
    for(int i=0;i<min(S1.size(),S2.size());i++)cout<<S1[i]<<" "<<S2[i]<<endl;
    cout<<endl;
    cout<<"OTHERS"<<endl;
    for(int i=0;i<min(S1_.size(),S2_.size());i++)cout<<S1_[i]<<" "<<S2_[i]<<endl;
    cout<<endl;
    */
    if(flg)cout<<"IDENTICAL"<<endl;
    else if(diff==1&&!d)cout<<"CLOSE"<<endl;
    else cout<<"DIFFERENT"<<endl;
  }
  return 0;
}