The problem "Almost Identical Programs" is part of a programming contest called "Concours de Programmation Comtemporaine Interuniversitaire" (CPCI), which has a judging system similar to ICPC. Contestants must submit correct outputs for two different inputs to be accepted as a correct solution. Each submission should include the program that generated the output. A pair of submissions is considered correct when, in addition to the correctness of the outputs, they include an identical program.

However, many contestants submit a different version of their programs in their second submissions, after modifying a single string literal representing the input file name, attempting to process different input. The organizers of CPCI want to show a special error message for such "close" submissions, indicating what's wrong with them.

The task is to detect such close submissions. The input consists of at most 100 datasets, each containing two strings representing the first and second submitted programs. The length of each string is between 1 and 200, inclusive. The end of the input is indicated by a line containing a period.

For each dataset, the judge result should be printed. If the given two programs are identical, print "IDENTICAL". If two programs differ with only one corresponding string literal, print "CLOSE". Otherwise, print "DIFFERENT". A string literal is a possibly empty sequence of characters between an odd-numbered occurrence of a double quote and the next occurrence of a double quote.

# Buggy version:
while 1:
    s1 = input().split('\"')
    if s1[0] == '.': break
    s2 = input().split('\"')

    jdg = 1
    cnt_d = 

    if len(s1) != len(s2): print("DIFFERENT")
    else:
        l = len(s1)
        i = 0
        while i < l:
            if s1[i] != s2[i]:
                cnt_d += 1
                if cnt_d == 1 and i % 2 == 1:
                    jdg = 1
                else:
                    jdg = 0
                    break
            i += 1

        if jdg == 1 and cnt_d == 1: print("CLOSE")
        elif jdg == 0 or cnt_d > 1: print("DIFFERENT")
        else: print("IDENTICAL")



# Fixed version:
while 1:
    s1 = input().split('\"')
    if s1[0] == '.': break
    s2 = input().split('\"')

    jdg = 1
    cnt_d = 0

    if len(s1) != len(s2): print("DIFFERENT")
    else:
        l = len(s1)
        i = 0
        while i < l:
            if s1[i] != s2[i]:
                cnt_d += 1
                if cnt_d == 1 and i % 2 == 1:
                    jdg = 1
                else:
                    jdg = 0
                    break
            i += 1

        if jdg == 1 and cnt_d == 1: print("CLOSE")
        elif jdg == 0 or cnt_d > 1: print("DIFFERENT")
        else: print("IDENTICAL")

# Buggy version:
results=[]
while True:
    a=input().split("\"")
    if a[0]==".":
        break
    b=input().split("\"")
    count1=0
    count2=0
    if len(a) != len(b):
        results.append(2)
    else:
        for i in range(len(a)):
            if(i%2==1):
                if len(a[i]) == len(b[i]):
                    count1+=1
                else:
                    for k,l in zip(a[i],b[i]):
                        if(k!=l):
                            count1+=1
            else:
                if len(a[i]) == len(b[i]):
                    count2+=1
                else:
                    for k,l in zip(a[i],b[i]):
                        if(k!=l):
                            count2+=1           
        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")
    



# Fixed version:
results=[]
while True:
    a=input().split("\"")
    if a[0]==".":
        break
    b=input().split("\"")
    count1=0
    count2=0
    if len(a) != len(b):
        results.append(2)
    else:
        for i in range(len(a)):
            if(i%2==1):
                if len(a[i]) != len(b[i]):
                    count1+=1
                else:
                    for k,l in zip(a[i],b[i]):
                        if(k!=l):
                            count1+=1
            else:
                if len(a[i]) != len(b[i]):
                    count2+=1
                else:
                    for k,l in zip(a[i],b[i]):
                        if(k!=l):
                            count2+=1           
        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")

# Buggy version:
s=[]

while 1:
    l1=input()
    if l1==".":
        break
    l2=input()

    sp1=l1.split('"')
    sp2=l2.split('"')
    
    t=0
    if len(sp1)==len(sp2):
        for i in range(len(sp1)):
            if i%2==1 and sp1[i]!=sp2[i]:
                t+=1
            elif i%2!=1 and sp1[i]!=sp2[i]:
                t+=2


    if sp1==sp2:
        s+=["IDENTCAL"]
    elif t==1:
        s+=["CLOSE"]
    else:
        s+=["DIFFERENT"]

for x in s:
    print(x)




# Fixed version:
s=[]

while 1:
    l1=input()
    if l1==".":
        break
    l2=input()

    sp1=l1.split('"')
    sp2=l2.split('"')
    
    t=0
    if len(sp1)==len(sp2):
        for i in range(len(sp1)):
            if i%2==1 and sp1[i]!=sp2[i]:
                t+=1
            elif i%2!=1 and sp1[i]!=sp2[i]:
                t+=2


    if sp1==sp2:
        s+=["IDENTICAL"]
    elif t==1:
        s+=["CLOSE"]
    else:
        s+=["DIFFERENT"]

for x in s:
    print(x)

# Buggy version:
ans=[]
while 1:
    s1=input().split('"')
    if s1==["."]: break
    s2=input().split('"')
    if len(s1)!=len(s2):
        ans.append("DIFFERENT")
        continue
    else:
        cnt=0
        for i in range(len(s1)):
            if s1[i]!=s2[i]:
                cnt+=1
            else: pass
        if cnt==0:
            ans.append("IDENTICAL")
        elif cnt==1:
            ans.append("CLOSE")
        else: 
            ans.append("DIFFERENT")
for i in range(len(ans)):
    print(ans[i])



# Fixed version:
ans=[]
while 1:
    s1=input().split('"')
    if s1==["."]: break
    s2=input().split('"')
    if len(s1)!=len(s2):
        ans.append("DIFFERENT")
        continue
    else:
        cnt=0
        flag=0
        for i in range(len(s1)):
            if s1[i]!=s2[i]:
                if i%2==0:
                    ans.append("DIFFERENT")
                    flag=1
                    break
                else:
                    cnt+=1
            else: pass
        if flag==1:
            continue
        else: pass
        if cnt==0:
            ans.append("IDENTICAL")
        elif cnt==1:
            ans.append("CLOSE")
        else: 
            ans.append("DIFFERENT")

for i in range(len(ans)):
    print(ans[i])

# Buggy version:
a1 = input()
a2 = input()
b1 = a1.split('"')
b2 = a2.split('"')
cnt = 0
if len(b1)==len(b2):
    for i in range(0,len(b1)):
        if i%2==0:
            if b1[i]!=b2[i]:
                cnt+=10000
                break
        if i%2!=0:
            if b1[i]!=b2[i]:
                cnt+=1
else:
    cnt+=10000

if cnt>1:
    print("DIFFERENT")
if cnt==1:
    print("CLOSE")
if cnt==0:
    print("IDENTICAL")


# Fixed version:
st = []
while(1):
    a1 = input()
    if a1 =='.':
        break
    a2 = input()
    b1 = a1.split('"')
    b2 = a2.split('"')
    cnt = 0
    if len(b1)==len(b2):
        for i in range(0,len(b1)):
            if i%2==0:
                if b1[i]!=b2[i]:
                    cnt+=10000
                    break
            if i%2!=0:
                if b1[i]!=b2[i]:
                    cnt+=1
    else:
        cnt+=10000
    
    if cnt>1:
        st.append("DIFFERENT")
    if cnt==1:
        st.append("CLOSE")
    if cnt==0:
        st.append("IDENTICAL")

for i in range(len(st)):
    print(st[i])

# Buggy version:
while 1:
    s1=input().split('"')
    if s1[0]==".":
        break
    s2=input().split('"')
     
    flag2=0
    cnt2=0
    flag=0
     
    if len(s1)!=len(s2):
        print("DIFFERENT")
    else:
        i=0
        while i<len(s1):
            if s1[i]==s2[i]:
                flag2=1
            elif i%2==0:
                print("DIFFERENT")
                flag=1
                break
            else:
                cnt2+=1
                if cnt2>1:
                    print("DIFFERENT")
                    break
            i+=1
                 
        if flag==0 and cnt2==1:
            print("CLOSE")
        if flag2==1:
            print("IDENTICAL")


# Fixed version:
while 1:
    s1=input().split('"')
    if s1[0]==".":
        break
    s2=input().split('"')
     
    cnt1=0
    cnt2=0
    flag=0
     
    if len(s1)!=len(s2):
        print("DIFFERENT")
    else:
        i=0
        while i<len(s1):
            if s1[i]==s2[i]:
                cnt1+=1
            elif i%2==0:
                print("DIFFERENT")
                flag=1
                break
            else:
                cnt2+=1
                if cnt2>1:
                    print("DIFFERENT")
                    break
            i+=1
                 
        if flag==0 and cnt2==1:
            print("CLOSE")
        if cnt1==len(s1):
            print("IDENTICAL")

# Buggy version:
while(1):
    a = input()
    if(a == '.'):
        break
    b = input()
    n = len(a)
    m = len(b)
    l = 0
    flag = 0
    idx_dif = 0
    error_cou = 0

    while(1):
        if(flag == 0):
            for i in range(l,n):
                if(a[i] == '\"'):
                    if(i+idx_dif < m and a[l:i+1] == b[l+idx_dif:i+idx_dif+1]):
                        l = i+1
                        flag = 1
                    else:
                        flag = 2
                    break

                elif(i == n-1):
                    if(a[l:i] != b[l+idx_dif:m-1]):
                        flag = 2
                    else:
                        l = n-1

        elif(flag == 1):
            for i in range(l,n):
                if(a[i] == '\"'):
                    for j in range(l+idx_dif,m):
                        if(b[j] == '\"'):
                            if(a[l:i+1] != b[l+idx_dif:j+1]):
                                error_cou += 1
                            idx_dif = j-i
                            l = i+1
                            flag = 0
                            break
                        if(j == m-1):
                            flag = 2
                            break

        if(flag == 2 or l >= n-1 or l+idx_dif >= m-1):
            break

    if(error_cou >= 2 or flag == 2):
        print("DIFFERENT")
    elif(error_cou == 1):
        print("CLOSE")
    elif(error_cou == 0):
        print("IDENTICAL")


# Fixed version:
while(1):
    a = input()
    if(a == '.'):
        break
    b = input()
    n = len(a)
    m = len(b)
    l = 0
    flag = 0
    idx_dif = 0
    error_cou = 0
 
    while(1):
        if(flag == 0):
            for i in range(l,n):
                if(a[i] == '\"'):
                    if(i+idx_dif < m and a[l:i+1] == b[l+idx_dif:i+idx_dif+1]):
                        l = i+1
                        flag = 1
                    else:
                        flag = 2
                    break
 
                elif(i == n-1):
                    if(a[l:i] != b[l+idx_dif:m-1]):
                        flag = 2
                    else:
                        l = n-1
 
        elif(flag == 1):
            for i in range(l,n):
                if(a[i] == '\"'):
                    for j in range(l+idx_dif,m):
                        if(b[j] == '\"'):
                            if(a[l:i+1] != b[l+idx_dif:j+1]):
                                error_cou += 1
                            idx_dif = j-i
                            l = i+1
                            flag = 0
                            break
                        if(j == m-1):
                            flag = 2
                            break
                if(flag != 1):
                    break
 
        if(flag == 2 or l >= n-1 or l+idx_dif >= m-1):
            break
 
    if(error_cou >= 2 or flag == 2):
        print("DIFFERENT")
    elif(error_cou == 1):
        print("CLOSE")
    elif(error_cou == 0):
        print("IDENTICAL")

# Buggy version:
A=[]
while True:	
	a=input().split('"')
	if a[0]==".":
		break
	b=input().split('"')
	
	cnt=0

	if len(a)!=len(b):
		A.append(-1)
	else:
		for i in range(len(a)):
			if(a[i]==b[i]):
				pass
			else:
				cnt+=1
		if cnt>=2:
			A.append(-1)
		if cnt==1:
			A.append(0)
		if cnt==0:
			A.append(1)

A.reverse()
#print(A)
for i in range(len(A)):
	tmp=A.pop()
	if tmp==-1:
		print("DIFFERENT")
	elif tmp==0:
		print("CLOSE")
	else:
		print("IDENTICAL")


# Fixed version:
A=[]
while True:	
	a=input().split('"')
	if a[0]==".":
		break
	b=input().split('"')
	
	cnt=0

	if len(a)!=len(b):
		A.append(-1)
	else:
		for i in range(len(a)):
			if(a[i]==b[i]):
				pass
			else:
				if i%2==1:
					cnt+=1
				else:
					cnt+=2
		if cnt>=2:
			A.append(-1)
		if cnt==1:
			A.append(0)
		if cnt==0:
			A.append(1)

A.reverse()
#print(A)
for i in range(len(A)):
	tmp=A.pop()
	if tmp==-1:
		print("DIFFERENT")
	elif tmp==0:
		print("CLOSE")
	else:
		print("IDENTICAL")

# Buggy version:
#16D8101014F 久留米 竜之介 Python3
#a=[]
while(True):
	i=0
	tmp=0
	a=input().split('"') 
	aL=len(a)
	if a[0] ==".":
		break
	b=input().split('"')
	bL=len(b)
		
	if aL != bL:
		print("DIFFELENT")
	else:
		while(True):
			if a[i] != b[i]:
				print("DIFFERENT")
				break
			elif i > aL-2:
				if tmp==1:
					print("CLOSE")
					break
				else:
					print("IDENTICAL")
					break
			elif a[i+1] != b[i+1]:
				if tmp==1:
					print("DIFFERENT")
					break
				else: tmp=1
			i +=2
	


# Fixed version:
#16D8101014F 久留米 竜之介 Python3
#a=[]
while(True):
	i=0
	tmp=0
	a=input().split('"') 
	aL=len(a)
	if a[0] ==".":
		break
	b=input().split('"')
	bL=len(b)
		
	if aL != bL:
		print("DIFFERENT")
	else:
		while(True):
			if a[i] != b[i]:
				print("DIFFERENT")
				break
			elif i > aL-2:
				if tmp==1:
					print("CLOSE")
					break
				else:
					print("IDENTICAL")
					break
			elif a[i+1] != b[i+1]:
				if tmp==1:
					print("DIFFERENT")
					break
				else: tmp=1
			i +=2

# Buggy version:
def vals(arr):
    even = True
    res = [[], []]
    tmp = []
    for e in arr:
        if e == "\"":
            even = not even
            res[even].append(tmp)
            tmp = []
            continue
        tmp.append(e)
    even = not even
    res[even].append(tmp)
    return res


while True:
    str1 = input()
    if str1 == ".":
        break
    a = vals(str1)
    b = vals(input())
    print(a)
    print(b)
    res = 0
    if len(a[0]) != len(b[0]) or len(a[1]) != len(b[1]) :
        res = 2
    else:
        for (x, y) in zip(a[0], b[0]):
            if x != y:
                res = 2
                break
    if res == 0:
        for (a, b) in zip(a[1], b[1]):
            if a != b:
                res += 1
                if res == 2:
                    break
    if res == 0:
        print("IDENTICAL")
    elif res == 1:
        print("CLOSE")
    else:
        print("DIFFERENT")



# Fixed version:
def vals(arr):
    even = True
    res = [[], []]
    tmp = []
    for e in arr:
        if e == "\"":
            even = not even
            res[even].append(tmp)
            tmp = []
            continue
        tmp.append(e)
    even = not even
    res[even].append(tmp)
    return res


while True:
    str1 = input()
    if str1 == ".":
        break
    a = vals(str1)
    b = vals(input())
    res = 0
    if len(a[0]) != len(b[0]) or len(a[1]) != len(b[1]) :
        res = 2
    else:
        for (x, y) in zip(a[0], b[0]):
            if x != y:
                res = 2
                break
    if res == 0:
        for (a, b) in zip(a[1], b[1]):
            if a != b:
                res += 1
                if res == 2:
                    break
    if res == 0:
        print("IDENTICAL")
    elif res == 1:
        print("CLOSE")
    else:
        print("DIFFERENT")