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;

//#define DEBUG
#ifdef DEBUG
#define dump(x) cout << "[*] " #x ": " << x << endl
#define debug(x) x
#else
#define dump(x)
#define debug(x)
#endif

int tbl1[201];
int tbl2[201];

void print_string(string& a, int s, int e) {
    const int m = e - s;
    cout << "[*] ";
    for (int i = 0; i < m; ++i) {
        cout << a[s+i];
    }
    cout << endl;
}

inline bool same(string& a, string& b, int a_s, int a_e, int b_s, int b_e) {
    if (a_e - a_s != b_e - b_s) {
        return false;
    }
    const int m = a_e - a_s;
    for (int i = 0; i < m; ++i) {
        if (a[a_s+i] != b[b_s+i]) {
            return false;
        }
    }
    return true;
}

inline bool d_same(string& a, string& b, int a_s, int a_e, int b_s, int b_e) {
    if (a_e - a_s != b_e - b_s) {
        dump(1);
        return false;
    }
    const int m = a_e - a_s;
    dump(m);
    for (int i = 0; i < m; ++i) {
        if (a[a_s+i] != b[b_s+i]) {
            return false;
        }
    }
    return true;
}

int main() {
    while (true) {
        string a, b;
        cin >> a;
        if (a[0] == '.' && a.size() == 1) {
            break;
        }
        for (int i = 0; i < 201; ++i) {
            tbl1[i] = tbl2[i] = 0;
        }
        cin >> b;

        if (a == b) {
            cout << "IDENTICAL" << endl;
            continue;
        }

        int tmp = 0;
        int cnt = 1;
        for (int i = 0; i < a.size(); ++i) {
            if (a[i] == '"') {
                dump(i);
                tbl1[cnt++] = i;
            }
        }
        tbl1[cnt++] = a.size();
        tmp = cnt;
        cnt = 1;
        for (int i = 0; i < b.size(); ++i) {
            if (b[i] == '"') {
                dump(i);
                tbl2[cnt++] = i;
            }
        }
        tbl2[cnt++] = b.size();
        if (tmp != cnt) {
            cout << "DIFFERENT" << endl;
            dump(1);
            continue;
        }

        int ai = 0, bi = 0;
        cnt = 0;
        bool str_flag = false;
        const bool fa = tbl1[1] == 0 && a[0] == '"';
        const bool fb = tbl2[1] == 0 && b[0] == '"';
        dump(fa);
        dump(fb);
        if (fa && fb) {
            str_flag = true;
        } else if (fa || fb) {
            cout << "DIFFERENT" << endl;
            dump(2);
            continue;
        }

        tmp--;
        bool continue_flag = false;
        for (int i = static_cast<int>(tbl1[0] == tbl1[1]); i < tmp; ++i) {
            dump(str_flag);
            if (!same(a, b, tbl1[i], tbl1[i+1], tbl2[i], tbl2[i+1])) {
                if (str_flag) {
                    cnt++;
                } else {
                    debug(print_string(a, tbl1[i], tbl1[i+1]));
                    debug(print_string(b, tbl2[i], tbl2[i+1]));
                    debug(d_same(a, b, tbl1[i], tbl1[i+1], tbl2[i], tbl2[i+1]));
                    cout << "DIFFERENT" << endl;
                    continue_flag = true;
                    dump(3);
                    break;
                }
            }
            str_flag = !str_flag;
            if (cnt > 1) {
                cout << "DIFFERENT" << endl;
                continue_flag = true;
                dump(4);
                break;
            }
        }
        if (!continue_flag)
            cout << "CLOSE" << endl;
    }
    return 0;
}