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)
}

Python: import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**13
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    rr = []

    def f(s,t):
        if s == t:
            return 'IDENTICAL'
        sa = s.split('"')
        ta = t.split('"')
        if len(sa) != len(ta):
            return 'DIFFERENT'
        ef = False
        for i in range(len(sa)):
            si = sa[i]
            ti = ta[i]
            if si == ti:
                continue
            if i % 2 == 0 or ef:
                return 'DIFFERENT'
            ef = True
        return 'CLOSE'

    while 1:
        n = S()
        if n == '.':
            break
        rr.append(f(n,S()))

    return '\n'.join(map(str,rr))


print(main())

Python: #!/usr/bin/python
import sys
if sys.version_info[0]>=3: raw_input=input

def solve(s,t):
	if s==t:
		return 'IDENTICAL'
	s=s.split('"')
	t=t.split('"')
	if len(s)==len(t):
		k0=sum(s[i]!=t[i] for i in range(0,len(s),2))
		k1=sum(s[i]!=t[i] for i in range(1,len(s),2))
		if k0==0 and k1==1:
			return 'CLOSE'
	return 'DIFFERENT'

try:
	while True:
		s=raw_input().strip()
		if s=='.': break
		t=raw_input().strip()
		print(solve(s,t))
except EOFError:
	pass

Python: while True:
  S_1 = input()
  if S_1 == '.':
    break
  S_2 = input()
  
  if S_1 == S_2:
    print("IDENTICAL")
    continue
  
  A = [0]
  B = [0]
  for i, s in enumerate(S_1):
    if s == '"':
      A.append(i)
  for i, s in enumerate(S_2):
    if s == '"':
      B.append(i)
      
  if len(A) != len(B):
    print('DIFFERENT')
    continue
  
  A.append(len(S_1))
  B.append(len(S_2))
  cnt = 0
  
  for i in range(len(A) - 1):
    if i % 2 == 0 and S_1[A[i]:A[i + 1]] != S_2[B[i]:B[i + 1]]:
      print('DIFFERENT')
      break
    if i % 2 == 1 and S_1[A[i]:A[i + 1]] != S_2[B[i]:B[i + 1]]:
      cnt += 1
  else:
      print('DIFFERENT' if cnt > 1 else 'CLOSE')

Python: while (True):
    s1=input()
    if (s1=="."):
        break
    s2=input()
    l1=s1.split("\"")
    l2=s2.split("\"")
   #print(l1,l2)
    if (len(l1)!=len(l2)):
        print("DIFFERENT")
        continue
    error=0
    for i in range(len(l1)):
        #print(l1,l2,i)
        if (l1[i]!=l2[i] and i%2==0):
            print("DIFFERENT")
            error=-1
            break
        if (len(l1[i])!=len(l2[i])):
            error+=1
        else:
            for j in range(min(len(l1[i]),len(l2[i]))):
            #   print(l1[i][j],l2[i][j])
                if (l1[i][j]!=l2[i][j]):
                    error+=1
                    break

    if (error==0):
        print("IDENTICAL")
    elif (error==1):
        print("CLOSE")
    elif(error>=2):
        print("DIFFERENT")

Python: s1=[]
s2=[]
O=[]
while 1:
    A=input().split('"')
    if A==["."]:
        break
    i=0
    cnt=0
    B=input().split('"')
    l1=len(A)
    l2=len(B)
    if l1==l2:   
        while i<l1 and i<l2:
            if A[i]!=B[i]:
                cnt+=1
                if i%2==0:
                    cnt+=2
            i+=1
        if cnt==0:
            O.append("IDENTICAL")
        elif cnt==1:
            O.append("CLOSE")
        else:
            O.append("DIFFERENT")
    else:
        O.append("DIFFERENT")
for i in range(len(O)):
    print(O[i])

Python: # from sys import exit

while(True):
    S0 = str(input())
    if S0 == ".":
        exit()
    S1 = str(input())
    if S0 == S1:
        print("IDENTICAL")
        continue
    S0else = set(S0.split('"')[0::2])
    S1else = set(S1.split('"')[0::2])
    if S0else != S1else:
        print("DIFFERENT")
        continue
    S0str = set(S0.split('"')[1::2])
    S1str = set(S1.split('"')[1::2])
    sol = S0str | S1str
    if len(sol) - 1 == len(S0str):
        print("CLOSE")
    else:
        print("DIFFERENT")

Python: results=[]
while True:
    a=list(map(input().split("\"")))
    if a[0]==".":
        break
    b=list(map(input().split("\"")))
    count1=0
    count2=0
    for i in range(int(len(a))):
        if(i%2==1):
            for (k,l) in zip(a[i],b[i]):
                if(k!=l):
                    count1+=1
        else:
            for k,l in zip(a[i],b[i]):
                if(k!=l):
                    count2+=1
    if len(a) != len(b):
        results.append(2)
    else:
        if count1==0 and count2==0:
            results.append(0)
        elif count1==1 and count2==0:
            results.append(1)
        else:
            results.append(2)
for i in results:
    if i==0:
        print("IDENTICAL")
    if i==1:
        print("CLOSE")
    if i==2:
        print("DIFFERENT")