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;

bool solve(){
    char s[500],t[500];
    ll n,m,i,j;
    cin >> s;
    n = strlen(s);
    if(n == 1 && s[0] == '.')return false;
    cin >> t;
    m = strlen(t);
    ll check = 0;
    ll reads = 0,readt = 0;
    ll sums = 0,sumt = 0;
    ll semicount = 0;
    while(1){
        while(s[reads + sums] != '"' && reads + sums < n){
            reads ++;
        }
        while(t[readt + sumt] != '"' && readt + sumt < m){
            readt ++;
        }
        if(reads == readt){
            bool dame = false;
            for(ll i=0;i<reads;i++){
                if(s[i + sums] != t[i + sumt]){
                    dame = true;
                }
            }
            if(dame && semicount % 2 == 1){
                check ++;
            }else if(dame && semicount % 2 == 0){
                check += 100;
            }
        }else{
            if(semicount % 2 == 1){
                check ++;
            }else{
                check += 100;
            }
        }

        semicount ++;
        
        if(reads + sums >= n && readt + sumt >= m)break;
        sums += reads;
        sumt += readt;
        reads = 1;
        readt = 1;

    }
    ll a=0,b = 0;
    for(i=0;i<n;i++){
        if(s[i] == '"')a++;
    }
    for(i=0;i<m;i++){
        if(t[i] == '"')b++;
    }
    if(a != b)check += 100;
    if(check == 0){
        cout << "IDENTICAL" << endl;
    }else if(check == 1){
        cout << "CLOSE" << endl;
    }else{
        cout << "DIFFERENT" << endl;
    }
    return true;
}



int main(){
    while(solve()){}
}

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

string s;
string tt;
int ans;
int ff;

int main(){
  cin >> s;
  while(s!="."){
    ans=0;
    ff=0;
    int i=0;
    int j=0;
    cin >> tt;
    for(;i<int(s.size())&&j<int(tt.size());){
      if(s[i]==tt[j]&&s[i]!=0x22&&tt[j]!=0x22){
        ++i;
        ++j;
        continue;
      }
      if(s[i]!=tt[j]){
        ans=1;
        break;
      }
      if(s[i]==0x22&&tt[j]==0x22){
        ++i;
        ++j;
        for(;s[i]!=0x22&&tt[j]!=0x22;){
          if(s[i]!=tt[j]){
            ++ff;
            break;
          }
          ++i;
          ++j;
        }
        while(s[i]!=0x22){
          ++i;
        }
        while(tt[j]!=0x22){
          ++j;
        }
        ++i;
        ++j;
      }

      if(ans==1)break;
    }
    if(i==int(s.size())&&j==int(tt.size())){}
    else{
      ans=1;
    }
    if(ans==1){
      printf("DIFFERENT\n");
    }
    else if(ff==0){
      printf("IDENTICAL\n");
    }
    else{
      printf("CLOSE\n");
    }
    cin >> s;
  }
}

C++: #include "bits/stdc++.h"
using namespace std;
//#define int long long
#define rep(i,a,b) for(int i=(a);i<(b);i++)

signed main() {
	for (string a; cin >> a && a != ".";) {
		string b; cin >> b;
		vector<string> p, q;
		string t = "";
		for (char c : a) {
			if (c != '"')
				t += c;
			else {
				p.push_back(t);
				t.clear();
			}
		}
		p.push_back(t);
		t = "";
		for (char c : b) {
			if (c != '"')
				t += c;
			else {
				q.push_back(t);
				t.clear();
			}
		}
		q.push_back(t);
		if (p.size() != q.size()) {
			cout << "DIFFERENT" << endl;
		}
		else if (p == q) {
			cout << "IDENTICAL" << endl;
		}
		else {
			int cnt = 0;
			bool close = true;
			for (int i = 0; i < p.size(); i += 2) {
				if (p[i] != q[i])
					close = false;
			}
			for (int i = 1; i < p.size(); i += 2) {
				if (p[i] != q[i])cnt++;
			}
			if (cnt == 1 && close) {
				cout << "CLOSE" << endl;
			}
			else {
				cout << "DIFFERENT" << endl;
			}
		}
	}
	return 0;
}

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

int main()
{
	string s1, s2;
	while (cin >> s1, s1 != ".") {
		cin >> s2;
		if (s1 == s2) {
			puts("IDENTICAL");
			continue;
		}
		int n1 = s1.size(), n2 = s2.size();
		bool ok = true;
		int i1 = 0, i2 = 0, cnt = 0;
		while (i1 < n1 || i2 < n2) {
			string t1, t2;
			while (i1 < n1 && s1[i1] != '\"') t1.push_back(s1[i1++]);
			while (i2 < n2 && s2[i2] != '\"') t2.push_back(s2[i2++]);
			if (t1 != t2) {
				ok = false;
				break;
			}
			if (i1 < n1) ++i1;
			if (i2 < n2) ++i2;
			if (i1 == n1 || i2 == n2) break;
			t1.clear(), t2.clear();
			while (i1 < n1 && s1[i1] != '\"') t1.push_back(s1[i1++]);
			while (i2 < n2 && s2[i2] != '\"') t2.push_back(s2[i2++]);
			if (t1 != t2) ++cnt;
			if (i1 < n1) ++i1;
			if (i2 < n2) ++i2;
		}
		if (i1 != n1 || i2 != n2) ok = false;
		puts(ok && cnt == 1 ? "CLOSE" : "DIFFERENT");
	}
	return 0;
}