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;
using ll = long long;
using pii = pair<int, int>;

int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  
  string s, t;
  while (cin >> s >> t, s != ".") {
    if (s == t) {
      cout << "IDENTICAL" << endl;
      continue;
    }
    int p = 0, q = 0;
    int sz = s.size(), tz = t.size();
    int flag = 0;
    int miss = 0;
    while (p < sz && q < tz) {
      if (s[p] == '"' && t[q] == '"') {
        int np = p + 1, nq = q + 1;
        while (s[np] != '"') np++;
        while (t[nq] != '"') nq++;
        miss += s.substr(p, np - p) != t.substr(q, nq - q);
        p = np, q = nq;
      } else if (s[p] != t[q]) {
        flag = 1;
        break;
      }
      p++, q++;
      if ((p == sz) ^ (q == tz)) {
        flag = 1;
        break;
      }
    }
    if (miss > 1 || flag) cout << "DIFFERENT" << endl;
    else cout << "CLOSE" << endl;
  }  

  return 0;
}

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

int main(){
  string str1,str2;

  while(cin >> str1, str1!="."){
    cin >> str2;
    bool frg = true;
    int er_cnt = 0;
    int j=0;
    int v1_cnt = 0;
    int v2_cnt = 0;
    for(int i=0; i<str1.size(); ++i){
      vector<char> v1;
      vector<char> v2;

      while(str1[i]!= '"' && i<str1.size()){
	v1.push_back(str1[i]);
	++i;
      }
      
      while(str2[j]!='"' && j<str2.size()){
	v2.push_back(str2[j]);
	++j;
      }
      ++j;
      
      if(v1!=v2 || v1.size()!=v2.size()){
	if(frg == true){
	  er_cnt = er_cnt+2;
	}else if(frg == false){
	  ++er_cnt;
	}
      }
      frg = !frg;
    }
    for(auto i: str1){
      if(i=='"'){++v1_cnt;}
    }
    for(auto i: str2){
      if(i=='"'){++v2_cnt;}
    }
    if(v1_cnt != v2_cnt){
      er_cnt = er_cnt + 2;
    }

    if(er_cnt == 0){
      cout << "IDENTICAL" << endl;
    }else if(er_cnt == 1){
	cout << "CLOSE" << endl;
      }else{
      cout << "DIFFERENT" << endl;
    }
    
  }
  return 0;
}

C++: #include <iostream>  
#include <algorithm>  
#include <functional>  
#include <vector>  
#include <map>
#include <string>
#include <queue>
#include <deque> 
#include <cmath>
using namespace std;
#define _USE_MATH_DEFINES
#include <math.h>
int main(){
	int i;
	char a[205];
	char b[205];
	int cur=0;
	int flag=0;
	int wrong=0;
	while(scanf("%s",a+1)){
		if(a[1]=='.'&&a[2]=='\0') break;
		scanf("%s",b+1);
		cur=1;
		flag=0;
		wrong=0;
		for(i=1;;i++){
			if(a[i]=='\0') break;
			if(a[i]==b[cur]){
				if(a[i]=='"'){
					if(flag==0) flag=1;
					else flag=0;
				}
				cur++;
				continue;
			}
			else if(a[i]!=b[cur]){
				if(flag==1){
					wrong++;
					flag=0;
					while(a[i]!='"'){
						i++;
					}
					while(b[cur]!='"'){
						cur++;
					}
					cur++;
				}
				else wrong=2;
			}
			if(wrong>=2) break;
		}
		if(wrong>=2) printf("DIFFERENT\n");
		else if(wrong==0) printf("IDENTICAL\n");
		else printf("CLOSE\n");
	}
	return 0;
}

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

string s, t;

string solve();

int main() {
  while(1) {
    cin >> s;
    if(s == ".") break;
    cin >> t;
    cout << solve() << endl;
  }
  return 0;
}

string solve() {
  if(s == t) return "IDENTICAL";
  int si = 0, ti = 0, cnt = 0;
  while(si < s.size() && ti < t.size()) {
    if(s[si] != t[ti]) return "DIFFERENT";
    if(s[si] == '"') {
      string sc, tc;
      while(s[++si] != '"') sc += s[si];
      while(t[++ti] != '"') tc += t[ti];
      if(sc != tc) ++cnt;
    }
    ++ti, ++si;
  }
  if(cnt == 1 && si == s.size() && ti == t.size())
    return "CLOSE";
  return "DIFFERENT";
}

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

int main() {
    string s1, s2;
    while (1) {
        cin >> s1;
        if (s1[0] == '.') break;
        cin >> s2;
        int count = 0;
        if (s1 == s2) {
            cout << "IDENTICAL" << endl;
            continue;
        }
        int n1 = 0;
        int n2 = 0;
        int size1 = s1.size();
        int size2 = s2.size();
        while (1) {
            if (n1 == size1 - 1 && n2 == size2 - 1) {
                if (count == 1) {
                    cout << "CLOSE" <<endl;
                }
                break;
            }
            if (s1[n1] == '"' && s2[n2] == '"') {
                int c1 = n1 + 1;
                int c2 = n2 + 1;
                bool diff = false;
                while (1) {
                    if (s1[c1] == '"' && s2[c2] == '"') {
                        n1 = c1;
                        n2 = c2;
                        break;
                    }
                    if (s1[c1] != s2[c2] && !diff) {
                        count++;
                        diff = true;
                    }
                    if (s1[c1] != '"') c1++;
                    if (s2[c2] != '"') c2++;
                }
            }
            if (s1[n1] != s2[n2]) {
                cout << "DIFFERENT" << endl;
                break;
            }
            if (count >= 2) {
                cout << "DIFFERENT" <<endl;
                break;
            }

            if (n1 != size1 - 1) n1++;
            if (n2 != size2 - 1) n2++;
        }
    }
    return 0;
}