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;
//type
typedef long long ll;
using pii = pair<int, int>;
using vi = vector<int>;
//x * y * 1.0 can cause overflow
//constant
#define inf (int)(1e9+7)
#define mod (ll)(1e9+7)
#define eps 1e-10
//int dy[] = {0, 0, -1, 1, -1, 1, -1, 1}; //右、左、マイナス、プラス
//int dx[] = {1, -1, 0, 0, -1, 1, 1, -1};
//omission
#define eb emplace_back
#define F first
#define S second
#define SZ(x) ((int)(x).size())
#define all(v) v.begin(), v.end()
//manip
template<class T> bool chmax(T &a, T &b) {if (a < b) {a = b; return 1;} return 0;}
#define chmin(a, b) a = min(a, b)
#define UNIQUE(v) v.erase(unique(v.begin(), v.end(), v.end());
#define ceil(a, b) a / b + !!(a % b)
template<class T> T power(T a, T b)
{return b ? power(a * a % inf, b / 2) * (b % 2 ? a : 1) % inf : 1;}
#define LB(v, x) (int)(lower_bound(v.begin(), v.end(), x) - v.begin())
#define UB(v, x) (int)(upper_bound(v.begin(), v.end(), x) - v.begin())
//loop
#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define rep3(i, st, n) for (int i = st; i < n; ++i)
//algorithm
//double pointer, l start, how many adds, can be 0 -> init r = l, sum = 0
//bfs, not x, y, i, j
//not !(i % 2), i % 2 == 0






int main() {
    //cast caution
    //look constraints always
    cin.tie(0); ios::sync_with_stdio(false);
    
    
    
    
    
    
    string s;
    while (cin >> s && s != ".") {
        string t; cin >> t;
        
        // " の数
        int cnt = 0;
        rep(i, SZ(s)) if (s[i] == '"') cnt++;
        int cnt2 = 0;
        rep(i, SZ(t)) if (t[i] == '"') cnt2++;
        if (cnt != cnt2) {
            cout << "DIFFERENT" << endl;
            continue;
        }
        
        
        
        
        
        
        vector<string> ss;
        int flg = 0;
        string tmp;
        rep(i, SZ(s)) {
            if (flg == 0) {
                if (s[i] == '"') {ss.eb(tmp); tmp = ""; flg = 1; continue;}
                tmp += s[i];
                
            } else {
                if (s[i] == '"') {flg = 0; continue;}
                
            }
        }
        if (tmp != "") {
            ss.eb(tmp);
        }
        tmp = "";
        /*
        rep(i, SZ(ss)) {
            cout << ss[i] << endl;
        }
        */
        
        flg = 0;
        vector<string> tt;
        rep(i, SZ(t)) {
            if (flg == 0) {
                if (t[i] == '"') {tt.eb(tmp); tmp = ""; flg = 1; continue;}
                tmp += t[i];
                
            } else {
                if (t[i] == '"') {flg = 0; continue;}
                
            }
        }
        if (tmp != "") {
            tt.eb(tmp);
        }
        tmp = "";
        /*
        rep(i, SZ(tt)) {
            cout << tt[i] << endl;
        }
        */
        
        
        
        if (SZ(ss) != SZ(tt)) {
            cout << "DIFFERENT" << endl;
            continue;
        }
        flg = 0;
        rep(i, SZ(ss)) {
            if (ss[i] != tt[i]) {
                cout << "DIFFERENT" << endl;
                flg = 1;
                break;
            }
            
        }
        if (flg) continue;
        ss.clear();
        tt.clear();
        
        flg = 0;
        rep(i, SZ(s)) {
            if (flg == 1) {
                if (s[i] == '"') {ss.eb(tmp); tmp = ""; flg = 0; continue;}
                tmp += s[i];
                
            } else {
                if (s[i] == '"') {flg = 1; continue;}
                
            }
        }
        
        
        if (tmp != "") {
            ss.eb(tmp);
        }
        tmp = "";
        /*
         rep(i, SZ(ss)) {
         cout << ss[i] << endl;
         }
        */
        
        flg = 0;
        
        rep(i, SZ(t)) {
            if (flg == 1) {
                if (t[i] == '"') {tt.eb(tmp); tmp = ""; flg = 0; continue;}
                tmp += t[i];
                
            } else {
                if (t[i] == '"') {flg = 1; continue;}
                
            }
        }
        if (tmp != "") {
            tt.eb(tmp);
        }
        tmp = "";
        /*
         rep(i, SZ(tt)) {
         cout << tt[i] << endl;
         }
        */
        
        
        cnt = 0;
        
        rep(i, SZ(ss)) {
            if (ss[i] != tt[i]) cnt++;
        }
        if (cnt >= 2) {
            cout << "DIFFERENT" << endl;
        } else if (cnt == 1) {
            cout << "CLOSE" << endl;
        } else {
            cout << "IDENTICAL" << endl;
            
        }
    }
        
}
//cast caution

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

int main(){
    while(1){
      std::string str1,str2;
      std::cin>>str1;
      if(str1==".") break;
      std::cin>>str2;
      std::string s11[201],s22[201];
      for(int i=0;i<201;i++){
        s11[i]=".";s22[i]=".";
      }
      s11[0]="";s22[0]="";
      int now1=0,now2=0;
      int l1,l2;
      l1=str1.size();
      l2=str2.size();
      for(int i=0;i<l1;i++){
        if(str1[i]=='"'){
          now1++;
          s11[now1]="";
        }else s11[now1]+=str1[i];
      }
      for(int i=0;i<l2;i++){
        if(str2[i]=='"'){
          now2++;
          s22[now2]="";
        }else s22[now2]+=str2[i];
      }
      int mistake=0;
      for(int i=0;i<201;i++){
        if(s11[i]!=s22[i]){
          if(i&1){
            mistake++;
          }else mistake+=2;
        }
      }
      if(mistake==0){
        std::cout<<"IDENTICAL";
      }else if(mistake==1){
        std::cout<<"CLOSE";
      }else{
        std::cout<<"DIFFERENT";
      }
      std::cout<<"\n";
    }
}