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<iostream>
#include<string>
using namespace std;
int main() {
	while (true) {
		string a, b;
		cin >> a;
		if (a == ".") {
			break;
		}
		cin >> b;
		if (a == b) {
			cout << "IDENTICAL" << endl;
			continue;
		}
		int modea = 0, modeb = 0;
		int i = 0, j = 0, k = 0, c = 0;
		while(a[i]==NULL){
			if (a[i+j] == '"') {
				switch(modea) {
					case 0:
						modea = 1;
						break;
					case 1:
						modea = 0;
						break;
				}
			}
			if (b[i+k] == '"') {
				switch(modeb) {
					case 0:
						modeb = 1;
						break;
					case 1:
						modeb = 0;
						break;
				}
			}
			if (modea == 1 and modeb==1) {
				if (a[i + j] != b[i + k]) {
					c++;
					continue;
				}
				j++;
				k++;
			}
			else if (modea == 1) {
				j++;
			}
			else if(modeb==1){
				k++;
			}
			else {
				if (a[i] != b[i]) {
					c = c + 2;
					break;
				}
				i++;
			}
		}
		if (c > 1) {
			cout << "DIFFERENT" << endl;
		}
		else {
			cout << "CLOSE" << endl;
		}
	}
}

C++: //author Eterna
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<string>
#include<cstring>
#include<vector>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<utility>
#include<cmath>
#include<climits>
#include<deque>
#include<functional>
#define max(a,b) (a>b?a:b)
#define min(a,b) (a<b?a:b)
#define INF 0x7fffffff
#define maxn 100000
#define eps 1e-15
#define MOD ((int)(1e9+7))
#define ABS(x) ((x)>=0?(x):(-(x)))
#define pb(x) push_back(x)
#define lowbit(x) (x&-x)
#define mid (L+R)/2
#define Lson (index*2)
#define Rson (index*2+1)
using namespace std;
typedef long long ll;
inline int read() {
	char c;
	int ret = 0, sgn = 1;
	do { c = getchar(); } while ((c < '0' || c > '9') && c != '-');
	if (c == '-') sgn = -1; else ret = c - '0';
	while ((c = getchar()) >= '0' && c <= '9') ret = ret * 10 + (c - '0');
	return sgn * ret;
}
string line1, line2;
int main(void)
{
	while (cin >> line1) {
		if (line1 == ".")break;
		bool flag = false;
		cin >> line2;
		if (line1 == line2) {
			cout << "IDENTICAL" << endl; continue;
		}
		int index = 0, i = 0, cnt = 0;
		bool kkk = false;
		for (i = 0; i < line1.size() && index < line2.size(); i++, index++) {
			if (line1[i] != line2[index]) {
				cout << "DIFFERENT" << endl;
				flag = true;
				break;
			}
			if (line1[i] == '"')kkk = true;
			if (kkk) {
				if (line2[index] != '"') {
					cout << "DIFFERENT" << endl;
					flag = true;
					break;
				}
				else {
					string s1, s2;
					for (int j = i + 1; j < line1.size(); j++) {
						if (line1[j] == '"') {
							s1 = line1.substr(i + 1, j - i - 1);
							i = j;
							kkk = false;
							break;
						}
					}
					for (int j = index + 1; j < line2.size(); j++) {
						if (line2[j] == '"') {
							s2 = line2.substr(index + 1, j - index - 1);
							index = j;
							kkk = false;
							break;
						}
					}
					if (s1 != s2) {
						cnt++;
					}
				}
			}
		}
	///	cout << cnt << endl;
		if (!flag&&cnt == 1) {
			cout << "CLOSE" << endl; continue;
		}
		if (cnt >= 2 && !flag) {
			cout << "DIFFERENT" << endl;; continue;
		}
		if (!flag) {
			if (i != line1.size() || index != line2.size()) {
				cout << "DIFFERENT" << endl;
			}
		}
	}
	//system("pause");
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
#define r(i,n) for(int i=0;i<n;i++)
string a[2],b;
string s[2][1001];
int p[2];
void dfs(int x){
  r(i,a[x].size()){
    if(a[x][i]=='"'){
      i++;s[x][p[x]]+='"';
      while(i<a[x].size()&&a[x][i]!='"')s[x][p[x]]+=a[x][i++];
      p[x]++;
    }else{
      while(i<a[x].size()&&a[x][i]!='"')s[x][p[x]]+=a[x][i++];
      p[x]++;
      i--;
    }
  }
}
main(){
  while(cin>>a[0],a[0]!="."){
    cin>>a[1];
    p[0]=p[1]=0;
    r(i,2)r(j,1001)s[i][j]="";
    r(i,2)dfs(i);
    if(p[0]!=p[1])cout<<"DIFFERENT"<<endl;
    else{
      int f1=0,f2=0;
      r(i,p[0])if(s[0][i]!=s[1][i]){
        if(s[0][i][0]=='"'&&s[1][i][0]=='"')f1++;
        else f2++;
      }
      if(f2||f1>1)cout<<"DIFFERENT"<<endl;
      else if(f1)cout<<"CLOSE"<<endl;
      else cout<<"IDENTICAL"<<endl;
    }
  }
}