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;
char stra[1000], strb[1000];
int lena, lenb;

int main()
{
//	freopen("a.in", "r", stdin);
//	freopen("out.txt", "w", stdout);
	while(true)
	{
		memset(stra, 0, sizeof(stra));
		memset(strb, 0, sizeof(strb));
		scanf("%s", stra);
		lena = strlen(stra);
		if(stra[0] == '.')
			break;
		scanf("%s", strb);
		lenb = strlen(strb);
		int posa = 0, posb = 0;
		int cnt = 0;
		bool ff = false;
		bool fa = false;
		int qa = 0, qb = 0;
		for(int i = 0; i < lena; i++)
			if(stra[i] == '\"')
				qa++;
		for(int i = 0; i < lenb; i++)
			if(strb[i] == '\"')
				qb++;
		if(qa != qb)
		{
			printf("DIFFERENT\n");
			ff = true;
			continue;
		}
		while(true)
		{
			if(posa >= lena && posb >= lenb)
			{
				break;
			}
			if(stra[posa] != strb[posb])
			{
				printf("DIFFERENT\n");
				ff = true;
				break;
			}
			if(stra[posa] == '\"')
			{
				bool fg = false;
				posa ++, posb ++;
				while(true)
				{
					if(stra[posa] == strb[posb] && strb[posb] == '\"')
					{
//						posa ++, posb ++;
						break;
					}
					if(stra[posa] == strb[posb])
					{
						posa ++, posb ++;
						continue;
					}
					else
					{
						cnt++;
						for(posa; posa < lena && stra[posa] != '\"'; posa++);
						for(posb; posb < lenb && strb[posb] != '\"'; posb++);
						fg = true;
						break;
					}
				}
				if(fg && cnt == 2)
				{
					printf("DIFFERENT\n");
					ff = true;
					break;
				}
			}
			posa ++, posb ++;
		}
		if(cnt == 1 && !ff)
			printf("CLOSE\n");
		else if(cnt == 0 && !ff && lena != lenb)
			printf("DIFFERENT\n");
		else if(!ff && cnt ==0 && lena == lenb)
			printf("IDENTICAL\n");
		else if(!ff)
			assert(false);
	}
	return 0;
}

C++: #include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "math.h"
#include "utility"
#include "string"
#include "map"
#include "unordered_map"
#include "iomanip"
#include "random"

using namespace std;
const long long int MOD = 1000000007;

long long int power(long long int x, long long int n, long long int M) {
	long long int tmp = 1;

	if (n > 0) {
		tmp = power(x, n / 2, M);
		if (n % 2 == 0) tmp = (tmp*tmp) % M;
		else tmp = (((tmp*tmp) % M)*x) % M;
	}
	return tmp;
}

long long int N, M, K, Q, W, H, L, R;
long long int ans;


int main() {
	ios::sync_with_stdio(false);
	string s, t;
	cin >> s;
	while (s != ".") {
		cin >> t;
		int flag = 0;
		vector<string>ss(100);
		vector<string>tt(100);
		string box, bag;
		for (auto i : s) {
			if (i == '"') {
				box += i;
				flag++;
			}
			else if (flag%2==0)box += i;
			else ss[flag/2] += i;
		}
		ss.resize(flag/2);
		flag = 0;
		for (auto i : t) {
			if (i == '"') {
				flag++;
				bag += i;
			}
			else if (flag%2==0)bag += i;
			else tt[flag/2] += i;
		}
		tt.resize(flag / 2);
		//cout << box << endl;
		//cout << bag << endl;
		if (box != bag)cout << "DIFFERENT\n";
		else {
			if (ss.size() != tt.size())cout << "DIFFERENT\n";
			else {
				int dis = 0;
				for (int i = 0; i < ss.size(); i++) {
					//cout << ss[i] << endl;
					//cout << tt[i] << endl;
					if (ss[i] != tt[i])dis++;
				}
				//cout << dis << endl;
				if (dis > 1)cout << "DIFFERENT\n";
				else if (dis)cout << "CLOSE\n";
				else cout << "IDENTICAL\n";
			}
		}
		cin >> s;
	}
	return 0;
}

C++: #include <stdio.h>

void cmpr1(char*, char*);

int main(int argc, char *argv[]){
    int i,r;
    char a[203],b[203];
    for(int i=0; i<100; i++){
        fgets(a, 203, stdin);
        if(a[0] == '.' && a[1] == '\n') break;
		//if (i != 0) printf("\n");
        fgets(b, 203, stdin);
        cmpr1(a,b);
		printf("\n");

    }
}

void cmpr1(char *a, char *b){
	int i = 0, j = 0;
    int q=0, f=0, g=0;
	for (int i = 0; i < 203;) {
        if(a[i] == '\n' || b[j] == '\n') {
			if (a[i] == b[j]){
				if (!f) {
					printf("IDENTICAL");
				}
				else {
					printf("CLOSE");
				}
				return;
			}
			printf("DIFFERENT");
            return;
        }
		if (!f && a[i] == '"' && b[j] == '"') {
			i++;
			j++;
			while (1) {
				if (a[i] == '"') {
					if (a[i] == b[j]) {
						break;
					}
					else {
						while (b[j] != '"') j++;
						f = 1;
						break;
					}
				}
				if (b[j] == '"') {
					while (a[i] != '"') i++;
					f = 1;
					break;
				}
				if (a[i] != b[j]) f = 1;
				i++;
				j++;
			}
		}
        if(a[i] != b[j]) {
            if(q){
                f = 1;
            }
            else{
                printf("DIFFERENT");
                return;
            }
        }
		i++;
		j++;
    }
    printf("ERROR");
}