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>
using namespace std;
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,n1,n2) for(int i=n1;i<n2;i++)
#define speed_up    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

typedef long long int ll;
typedef pair<ll,ll> Pi;
const int INF=(ll)(1LL<<31)-1;
const ll INFl=(ll)9223372036854775807;
const int MAX=10000;
const ll MOD=(ll)1e9+7;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a, b)*b;}
//int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};

template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

string s1,s2;
vector<string> f1;
vector<string> nf1;
vector<string> f2;
vector<string> nf2;

int main(){
	while(1){
		cin>>s1;
		if(s1==".")break;
		cin>>s2;
		int flag=0;//0 hutuu,1 ""
		string st;
		f1.clear();
		f2.clear();
		nf1.clear();
		nf2.clear();
		for(int i=0;i<s1.size();i++){
			if(s1[i]=='"'){
				if(flag){
					f1.push_back(st);
					st.erase(st.begin(),st.end());
					flag=0;
				}else{
					nf1.push_back(st);
					st.erase(st.begin(),st.end());
					flag=1;
				}
			}else{
				st+=s1[i];
				if(i==s1.size()-1){
					nf1.push_back(st);
					st.erase(st.begin(),st.end());
				}
			}
		}
		

		flag=0;
		for(int i=0;i<s2.size();i++){
			if(s2[i]=='"'){
				if(flag){
					f2.push_back(st);
					st.erase(st.begin(),st.end());
					flag=0;
				}else{
					nf2.push_back(st);
					st.erase(st.begin(),st.end());
					flag=1;
				}
			}else{
				st+=s2[i];
				if(i==s2.size()-1){
					nf2.push_back(st);
					st.erase(st.begin(),st.end());
				}
			}
		}
		
		/*for(int i=0;i<f1.size();i++){
			cout<<f1[i]<<" ";
		}
		cout<<endl;
		for(int i=0;i<nf1.size();i++){
			cout<<nf1[i]<<" ";
		}
		cout<<endl;
		for(int i=0;i<f2.size();i++){
			cout<<f2[i]<<" ";
		}
		cout<<endl;
		for(int i=0;i<nf2.size();i++){
			cout<<nf2[i]<<" ";
		}
		cout<<endl;*/
		
		int ans=0;
		int count=0;
		if(nf2.size()!=nf1.size()){
			cout<<"DIFFERENT"<<endl;
			goto A;
		}else{
			for(int i=0;i<nf2.size();i++){
				if(nf1[i]!=nf2[i]){
					cout<<"DIFFERENT"<<endl;
					goto A;
				}
			}
		}
		if(f1.size()!=f2.size()){
			cout<<"DIFFERENT"<<endl;
			goto A;
		}
		for(int i=0;i<f1.size();i++){
			if(f1[i]!=f2[i]){
				count++;
			}
		}
		if(count>1){
			cout<<"DIFFERENT"<<endl;
		}else if(count==1){
			cout<<"CLOSE"<<endl;
		}else{
			cout<<"IDENTICAL"<<endl;
		}
		A: 
		;
	}
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
string s1,s2;
int main(){
  while(cin >> s1 && s1!="."){
    cin >> s2;
    int counter=0;
    vector<string> s1word,s2word;
    for(int i=0;i<s1.size();i++){
      if(s1.size()!=s2.size()){
        counter=114514;
        break;
      }
      if(s1[i]==s2[i]);
      else counter++;
    }
    if(counter==0) cout << "IDENTICAL" << endl;
    else{
      //int mojicounter1,mojicounter2,mojicounter3,mojicounter4;
      for(int i=0;i<s1.size();i++){
        if(s1[i]=='"'){
          int j=1;
          while(i+j<s1.size()){
            if(s1[i+j]=='"'){
              string l=s1.substr(i+1,j-1);
              s1.erase(i+1,j);
              i--;;
              s1word.push_back(l);
              break;
            }
            j++;
          }
          i++;
        }
      }
      for(int i=0;i<s2.size();i++){
        if(s2[i]=='"'){
          int j=1;
          while(i+j<s2.size()){
            if(s2[i+j]=='"'){
              string l=s2.substr(i+1,j-1);
              s2.erase(i+1,j);
              i--;
              s2word.push_back(l);
              break;
            }
            j++;
          }
          i++;
        }
      }
      //cout << "s1:" <<s1 << " " << "s2:" << s2 << endl;
      counter=0;
      int flag=0;
      for(int i=0;i<s1.size();i++){
        if(s1.size()!=s2.size()){
          //cout << "DIFFERENT" << endl;
          flag++;
          break;
        }
        if(s1[i]!=s2[i]) counter++;
      }

      if(counter!=0){
        //cout << "DIFFERENT" << endl;
        flag++;
      }
      //cout << "flag;" << flag << endl;
      int counter2=0;
      if(s1word.size()!=s2word.size()){
        cout << "DIFFERENT" << endl;
      }
      else{
        for(int i=0;i<s1word.size();i++){
          //cout << s1word[i] << " " << s2word[i] << endl;
          if(s1word[i]!=s2word[i]) counter2++;
        }
        if(flag>0) cout << "DIFFERENT" << endl;
        else if(counter2<=1) cout << "CLOSE" << endl;
        else cout << "DIFFERENT" << endl;
      }
    }
  }
  return 0;
}