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;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9;
const ll LINF = 1e18;
inline ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
inline ll lcm(ll a, ll b) { return a / gcd(a, b)*b; }
template<class S,class T> ostream& operator << (ostream& out,const pair<S,T>& o){ out << "(" << o.first << "," << o.second << ")"; return out; }
template<class T> ostream& operator << (ostream& out,const vector<T>& V){ for(int i = 0; i < V.size(); i++){ out << V[i]; if(i!=V.size()-1) out << " ";} return out; }
template<class T> ostream& operator << (ostream& out,const vector<vector<T> >& Mat){ for(int i = 0; i < Mat.size(); i++) { if(i != 0) out << endl; out << Mat[i];} return out; }
template<class S,class T> ostream& operator << (ostream& out,const map<S,T>& mp){ out << "{ "; for(auto it = mp.begin(); it != mp.end(); it++){ out << it->first << ":" << it->second; if(mp.size()-1 != distance(mp.begin(),it)) out << ", "; } out << " }"; return out; }
template<typename T>vector<T> make_v(size_t a){return vector<T>(a);}
template<typename T,typename... Ts>auto make_v(size_t a,Ts... ts){return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));}
template<typename T,typename V> typename enable_if<is_class<T>::value==0>::type fill_v(T &t,const V &v){t=v;}
template<typename T,typename V> typename enable_if<is_class<T>::value!=0>::type fill_v(T &t,const V &v){for(auto &e:t) fill_v(e,v);}
/*
 <url:http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1617&lang=jp>
 問題文============================================================
 =================================================================
 解説=============================================================
 ================================================================
 */

pair<vector<string>,vector<string>> reader(const string s){
    vector<string> ret1,ret2;
    
    stringstream ss(s);
    int counter = 0;
    string t;
    while(getline(ss,t,'"')){
        if(counter%2 == 1){
            ret2.push_back(t);
        }else{
            ret1.push_back(t);
        }
        counter++;
    }
    return {ret1,ret2};
}
template<class Type>
Type solve(Type res = Type()){
    string s1,s2;
    while(cin>>s1){
        if(s1 == ".") break;
        cin >> s2;
        
        if(s1 == s2){
            cout << "IDENTICAL" << endl;
            continue;
        }
        vector<string> r11,r12,r21,r22;
        tie(r11,r12) = reader(s1);
        tie(r21,r22) = reader(s2);
        
//        cout << r11 << endl;
//        cout << r12 << endl;
//        cout << r21 << endl;
//        cout << r22 << endl;
        if(r11 != r21 || r12.size()!=r22.size()){
            cout << "DIFFERENT" << endl;
            continue;
        }
    
        int cnt = 0;
        for(int i = 0; i < r12.size();i++){
            if(r12[i]!=r22[i])cnt++;
        }
        if(cnt==0){
            cout << "IDENTICAL" << endl;
        }else if(cnt == 1){
            cout << "CLOSE" << endl;
        }else{
            cout << "DIFFERENT" << endl;
        }
    }
    return res;
}
int main(void) {
    cin.tie(0); ios_base::sync_with_stdio(false);
    solve(0);
    //cout << fixed << setprecision(15) << solve<ll>() << endl;
    return 0;
}

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

int main(){
    int cnt;
    bool odd;
    std::string str1;
    std::string str2;
    std::string tmp1;
    std::string tmp2;
    while(true){
        odd = false;
        std::cin >> str1;
        if(str1=="."){
            break;
        }
        std::cin >> str2;
        cnt = 0;
        std::istringstream iss1(str1);
        std::istringstream iss2(str2);
        while(std::getline(iss1,tmp1,'"')){
            if(std::getline(iss2,tmp2,'"')){
                if(tmp1!=tmp2){
                    if(odd){
                        cnt++;
                    }else{
                        cnt += 2;
                        break;
                    }
                }
            }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";
        }
    }
}

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

int main()
{
  std::string str1,str2;
  std::string ans;
  int l1,l2;
  int j=0;
  int cnt[10000]={0};
  while(str1[0]!='.'){
    std::getline(std::cin,str1);
    l1=str1.size();
    if(str1[0]=='.') break;
    std::getline(std::cin,str2);
    l2=str2.size();
    for(int i=0;i<l1;i++){
      if(str1[i]!=str2[i]){
	cnt[j]++;
      }
    }
    j++;
  }
  for(int i=0;i<j;i++){
    if(cnt[i]==0){
      std::cout<<"IDENTICAL"<<'\n';
    }else if(cnt[i]==1){
      std::cout<<"CLOSE"<<'\n';
    }else{
      std::cout<<"DEFFERENT"<<'\n';
    }
  }
    return 0;
}