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 <algorithm>
#include <math.h>
#include <string.h>
#include <map>
/*
std::string substrBack(std::string str, size_t pos, size_t len) {
	const size_t strLen = str.length();

	return str.substr(strLen - pos, len);
}*/

using namespace std;

int main() {
	while (true) {
		string s1,s2;
		string mozi;
		string data[1000];
		string data2[1000];
		string i1;
		string i2;
		int bun = 0;
		int cnt = 0;
		int flag = 0;
		int bun2 = 0;
		cin >> s1;
		if (s1 == ".") {
			return 0;
		}
		cin >> s2;
		for (int i = 0; i < (int)s1.size(); i++) {
			mozi = s1[i];
			if (flag == 1) {
				if (mozi == "\"") {
					flag = 0;
					bun++;
					cnt++;
				}
				else {
					data[cnt]+=mozi;
				}
			}else if (mozi == "\"") {
				flag = 1;
				i1 += "\"";
			}
			else {
				i1 += mozi;
			}
		}
		flag = 0;
		cnt = 0;
		for (int i = 0; i < (int)s2.size(); i++) {
			mozi = s2[i];
			if (flag == 1) {
				if (mozi == "\"") {
					flag = 0;
					cnt++;
					bun2++;
				}
				else {
					data2[cnt] += mozi;
				}
			}
			else if (mozi == "\"") {
				flag = 1;
				i2 += "\"";
			}
			else {
				i2 += mozi;
			}
		}
		int cnt2 = 0;
		for (int i = 0; i < bun; i++) {
			if (data[i] != data2[i]) {
				cnt2++;
			}
		}
		if (bun2 != bun) {
			cout << "DIFFERENT" << endl;
		}
		else {
			if (i1 == i2) {
				if (cnt2 == 1) {
					cout << "CLOSE" << endl;
				}
				else if (cnt2 == 0) {
					cout << "IDENTICAL" << endl;
				}
				else {
					cout << "DIFFERENT" << endl;
				}
			}
			else {
				cout << "DIFFERENT" << endl;
			}
		}
	}
	/*while (true) {
	string s;
	string c;
	string d;
	int kagi;
	char mozi;
	int maru;
	cin >> s;
	if (s == ".") {
		return 0;
	}
	int flag;
	for (int i = 0; i < (int)s.size(); i++) {
		flag = 0;
		mozi = s[i];
		if (mozi == '(' || mozi == '[') {
			c.push_back(mozi);
		}
		if (mozi == ')' || mozi == ']') {
			d = substrBack(c, 1, 1);
			kagi = d[0];
			if (kagi != mozi) {
				flag = 1;
				break;
			}
			c.pop_back();
		}
	}
		if (c.size() == 0 || flag == 1) {
			cout << "No" << endl;
		}
		else {
			cout << "Yes" << endl;
		}
	}*/

}

C++: #include<iostream>
#include<iomanip>
#include<cmath>
#include<cstdlib>
#include<cstring>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<numeric>
using namespace std;

#define R(i,s,n) for(int i=s;i<n;i++)
#define D(i,n,s) for(int i=n-1;i>=s;i--)
typedef pair<int,int> P;

string s1,s2;
string s1o="",s2o="";
vector<string> s1i,s2i;

int D1(int i){
  string t="";
  for(int j=i+1;1;j++){
    if(s1[j]=='"'){
      s1i.push_back(t);
      return j;
    }else{
      t += s1[j];
    }
  }
}

int D2(int i){
  string t="";
  for(int j=i+1;1;j++){
    if(s2[j]=='"'){
      s2i.push_back(t);
      return j;
    }else{
      t += s2[j];
    }
  }
}

int main() {
  while(cin >> s1 && s1 != "."){
    s1o="";s2o="";
    s1i.clear();s2i.clear();
    cin >> s2;
    R(i,0,s1.size()){
      if(s1[i]=='"'){
        s1o += '.';
        i = D1(i);
      }else{
        s1o += s1[i];
      }
    }
    R(i,0,s2.size()){
      if(s2[i]=='"'){
        s2o += '.';
        i = D2(i);
      }else{
        s2o += s2[i];
      }
    }

    if(s1o != s2o || s1i.size() != s2i.size()){
      cout << "DIFFERENT" << endl;
    }else{
      int count = 0;
      R(i,0,s1i.size()){
        if(s1i[i] != s2i[i]){
          count++;
        }
      }
      if(count==0){
        cout << "IDENTICAL" << endl;
      }else if(count==1){
        cout << "CLOSE" << endl;
      }else{
        cout << "DIFFERENT" << endl;
      }
    }
    /*
    cout << s1o << " " << s2o << endl;
    R(i,0,s1i.size()){
      cout << s1i[i] << " ";
    }
    cout << endl;
    R(i,0,s2i.size()){
      cout << s2i[i] << " ";
    }
    cout << endl<< endl;
    */
  }
}

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

int main(){
	while(1){
		string s1,s2;
		cin >> s1;
		if(s1 == ".") return 0;
		cin >> s2;
		string s11[201], s22[201];
		for(int i=0;i<201;i++){
			s11[i] = "."; s22[i] = ".";
		}
		int now1=0,now2=0;
		for(int i=0;i<(int)s1.length();i++){
			if(s1[i] == '"'){
				now1++;
				s11[now1] = "";
			}else s11[now1] += s1[i];
		}
		for(int i=0;i<(int)s2.length();i++){
			if(s2[i] == '"'){
				now2++;
				s22[now2] = "";
			}else s22[now2] += s2[i];
		}
		int d=0;
        int maxnow;
        if(now1 < now2) maxnow = now1;
        else maxnow = now2;
		for(int i=0;i<maxnow;i++){
			if(s11[i] != s22[i]){
				if(i&1){
					d++;
				}else d+=2;
			}
		}
		if(d==0)cout<<"IDENTICAL";
		else if(d==1)cout<<"CLOSE";
		else cout<<"DIFFERENT";
		cout<<"\n";
	}
}

C++: #include <bits/stdc++.h>
using namespace std;
typedef long long ll;

void split(string s, vector<string> &v){
    string tmp = "";
    for(int i = 0; i < s.size(); i++){
        if(s[i] == '"'){
            v.push_back(tmp);
            tmp = "";
        }
        else tmp += s[i];
    }
    if(tmp != "")v.push_back(tmp);
}

int main(){
    for(string s1, s2;cin >> s1, s1 != ".";){
        cin >> s2;
        vector<string>v1, v2;
        split(s1, v1);
        split(s2, v2);
        int cnt = 0;
        if(v1.size() == v2.size()){
            for(int i = 0; i < v1.size(); i++){
                if(v1[i] == v2[i])continue;
                if(i % 2)cnt++;
                else cnt = 2;
            }
        }
        else cnt = 2;
        if(cnt == 0)cout << "IDENTICAL" << endl;
        else if(cnt == 1)cout << "CLOSE" << endl;
        else cout << "DIFFERENT" << endl;
    }    

    return 0;
}