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++: #define _USE_MATH_DEFINES
#include <bits/stdc++.h>

using namespace std;

// repetition
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

// container util
#define all(x) (x).begin(), (x).end()

// debug
#define dump(x) cerr << #x << " = " << (x) << endl;
#define debug(x)                                         \
  cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" \
       << " " << __FILE__ << endl;

// typedef
typedef long long lint;
typedef unsigned long long ull;
typedef complex<long double> Complex;
typedef pair<int, int> P;
typedef tuple<int, int, int> TP;
typedef vector<int> vec;
typedef vector<vec> mat;

// constant
const int MOD = (int)1e9 + 7;
const int INF = (int)1e18;
const int dx[] = {0, 1, 0, -1};
const int dy[] = {1, 0, -1, 0};
const int ddx[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[] = {1, 1, 0, -1, -1, -1, 0, 1};

// conversion
inline int toInt(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
template <class T>
inline string toString(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}

//
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
//

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

  string s1, s2;
  while (true) {
    cin >> s1;
    if (s1 == ".") break;
    cin >> s2;

    int b = 0;
    bool flag = false;
    string ss1 = "", ss2 = "";
    vector<string> c_s1, c_s2, s_s1, s_s2;
    for (int i = 0; i < s1.size(); i++) {
      if (s1[i] == '"' && !flag) {
        b = i;
        flag = true;
        s_s1.push_back(ss1);
        ss1 = "";
        continue;
      }
      if (s1[i] == '"') {
        if (i - b == 1)
          c_s1.push_back("#");
        else
          c_s1.push_back(s1.substr(b, i - b));
        flag = false;
        continue;
      }
      if (!flag) ss1 += s1[i];
    }
    s_s1.push_back(ss1);

    b = 0;
    flag = false;
    for (int i = 0; i < s2.size(); i++) {
      if (s2[i] == '"' && !flag) {
        b = i;
        flag = true;
        s_s2.push_back(ss2);
        ss2 = "";
        continue;
      }
      if (s2[i] == '"') {
        if (i - b == 1)
          c_s2.push_back("#");
        else
          c_s2.push_back(s2.substr(b, i - b));
        flag = false;
        continue;
      }
      if (!flag) ss2 += s2[i];
    }
    s_s2.push_back(ss2);

    flag = false;
    if (s_s1.size() != s_s2.size()) {
      cout << "DIFFERENT\n";
      continue;
    }
    for (int i = 0; i < s_s1.size(); i++) {
      if (s_s1[i] != s_s2[i]) flag = true;
    }

    if (flag) {
      cout << "DIFFERENT\n";
      continue;
    }

    if (c_s1.size() != c_s2.size()) {
      cout << "DIFFERENT\n";
      continue;
    }

    int f = 0;
    for (int i = 0; i < c_s1.size(); i++) {
      if (c_s1[i] != c_s2[i]) f++;
    }
    if (f == 0) {
      cout << "IDENTICAL\n";
    } else if (f == 1) {
      cout << "CLOSE\n";
    } else {
      cout << "DIFFERENT\n";
    }
  }

  return 0;
}

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

int main(){
	while(1){
		string s1,s2;
		cin>>s1>>s2;
		
		if(s1=="."){
			break;
		}
		
		if(s1==s2){
			cout<<"IDENTICAL"<<endl;
		}
		
		string t1=s1;
		string t2=s2;
		
		while(1){
			size_t d1b=t1.find('\"');
			if(d1b==string::npos){
				break;
			}
			t1.replace(d1b,1,"@");
			size_t d1e=t1.find('\"');
			t1.replace(d1e,1,"@");
			
			size_t d2b=t2.find('\"');
			if(d2b==string::npos){
				break;
			}
			t2.replace(d2b,1,"@");
			size_t d2e=t2.find('\"');
			t2.replace(d2e,1,"@");
		
			string u1=s1;
			string u2=s2;
			u1.replace(d1b+1,d1e-d1b-1,"");
			u2.replace(d2b+1,d2e-d2b-1,"");
	
			if(u1==u2){
				t1=u1;
				t2=u2;
				break;
			}
		}
		if(t1==t2){
			cout<<"CLOSE"<<endl;
		}else{
			cout<<"DIFFERENT"<<endl;
		}
			
	}
	return 0;
}

C++: #include <stdio.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define repn(i,n) for(int i=1;i<=n;i++)

string a,b;

int main(){
    while(1){
        cin>>a;
        if(a == ".") return 0;
        cin >> b;
        if(a == b) { cout << "IDENTICAL" << endl; continue;}
        vector<string>x[2],y[2];
        string xx = "";
        bool in = 0;
        for(int i=0;i<=a.size();i++){
            if(i==a.size()||a[i] == '"'){
                if(!in) x[0].push_back(xx);
                else y[0].push_back(xx);
                in ^= 1;
                xx = "";
            }
            else xx.push_back(a[i]);
        }
        xx = ""; in = 0;
        for(int i=0;i<=b.size();i++){
            if(i==b.size() || b[i] == '"'){
                if(!in) x[1].push_back(xx);
                else y[1].push_back(xx);
                in ^= 1;
                xx = "";
            }
            else xx.push_back(b[i]);
            }
        //cout << y[0][0] << " " << y[1][0] << endl;
        if(x[0] != x[1]) cout << "DIFFERENT" << endl;
        else if(y[0].size() != y[1].size()) cout << "DIFFERENT" << endl;
        else{
            int c = 0;
            for(int i=0;i<y[0].size();i++) c += (y[0][i] != y[1][i]);
            if(c == 1) cout << "CLOSE" << endl;
            else cout <<"DIFFERENT" << endl;
        }
    }
}