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 <algorithm>
#include <array>
#include <cassert>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <sstream>
#include <string>
#include <utility>
#include <vector>
#define FOR(i,a,b) for (int i=(a),for_##i##_max=(b);i<=(for_##i##_max);++i)
#define RFOR(i,a,b) for (int i=(a),rfor_##i##_min=(b);i>=(rfor_##i##_min);--i)
#define REP(i,n) for (int i=0,rep_##i##_len=(n);i<(rep_##i##_len);++i)
#define RREP(i,n) for (int i=(n)-1;i>=0;--i)

namespace { // Basics

template<typename T>
void chmin(T &x, T y) {
  x = std::min(x, y);
}

template<typename T>
void chmax(T &x, T y) {
  x = std::max(x, y);
}

template<typename T>
__attribute__((unused))
const auto minimum = static_cast<T const &(*)(T const &, T const &)>(std::min);

template<typename T>
__attribute__((unused))
const auto maximum = static_cast<T const &(*)(T const &, T const &)>(std::max);

template<typename T>
__attribute__((unused))
T constexpr infty = std::numeric_limits<T>::max / 3;
template<>
__attribute__((unused))
auto constexpr infty<int> = 1'100'100'100;
template<>
__attribute__((unused))
auto constexpr infty<long long int> = 100'500'400'300'200'100LL;

using lli = long long int;
using ld = long double;

} // namespace

using namespace std;

vector<string> split(string str, char d) {
  istringstream s(str);
  string in;
  vector<string> val;
  while (getline(s,in,d)) val.push_back(in);
  return val;
}

using VS = vector<string>;

tuple<VS, VS>
string_partition(string const &prog) {
  auto const splits = split(prog, '"');
  vector<string> cmds, strs;
  for (int i = 0, len = (int)splits.size(); i < len; ++i) {
    (i % 2 == 0 ? cmds : strs).push_back(splits[i]);
  }
  return make_tuple(cmds, strs);
}

bool close(tuple<VS,VS> const &v1, tuple<VS,VS> const &v2) {
  VS c1, s1, c2, s2;
  tie(c1, s1) = v1, tie(c2, s2) = v2;
  if (c1 != c2 || s1.size() != s2.size()) {
    return false;
  }
  int differs = 0;
  for (int i = 0, len = (int)s1.size(); i < len; ++i) {
    if (s1[i] != s2[i]) {
      ++differs;
    }
  }
  return differs < 2;
}

void solve(string const &s1, string const &s2) {
  if (s1 == s2) {
    cout << "IDENTICAL" << endl;
    return;
  }
  auto const v1 = string_partition(s1);
  auto const v2 = string_partition(s2);
  cout << (close(v1, v2) ? "CLOSE" : "DIFFERENT") << endl;
}

int main() {
  // cout << fixed << setprecision(10);

  string S1, S2;
  while (cin >> S1 && S1 != "."s) {
    cin >> S2;
    solve(S1, S2);
  }
  return 0;
}

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

void split(std::vector<std::string>& tmp, std::string& str,char delimiter);

int main(){
    int cnt = 0;
    bool odd;
    std::string str1;
    std::string str2;
    std::string tmp1;
    std::string tmp2;
    while(true){
        cnt = 0;
        odd = false;
        std::cin >> str1;
        if(str1 == "."){
            break;
        }
        std::vector<std::string> tmp1;
        split(tmp1,str1,'"');
        std::cin >> str2;
        std::vector<std::string> tmp2;
        split(tmp2,str2,'"');
        int size = tmp1.size();
        int size2 = tmp2.size();
        if(size != size2){
            cnt += 2;
        }else{
            for(int i=0;i<size;i++){
                if(tmp1[i]!=tmp2[i]){
                    if(odd){
                        cnt++;
                    }else{
                        cnt += 2;
                        break;
                    }
                }
                if(odd){
                    odd = false;
                }else{
                    odd = true;
                }
            }
        }
        
        if(cnt==0){
            std::cout << "IDENTICAL\n";
        }else if(cnt==1){
            std::cout << "CLOSE\n";
        }else{
            std::cout << "DIFFERENT\n";
        }
    }
}



void split(std::vector<std::string>& tmp, std::string& str,char delimiter){
    std::istringstream iss(str);
    std::string item;
    while(std::getline(iss,item,'"')){
        tmp.push_back(item);
    }
}