Problem:


Almost Identical Programs

The programming contest named
Concours de Programmation Comtemporaine Interuniversitaire (CPCI)
has a judging system similar to that of ICPC;
contestants have to submit correct outputs for two different inputs
to be accepted as a correct solution.

Each of the submissions should include the program that generated
the output.  A pair of submissions is judged to be a correct
solution when, in addition to the correctness of the outputs, they
include an identical program.

Many contestants, however, do not stop including a different version
of their programs in their second submissions, after modifying a
single string literal in their programs representing 
the input file name, attempting to process different input.

The organizers of CPCI are exploring the possibility of showing a
special error message for such close submissions, 
indicating contestants what's wrong with such submissions.

Your task is to detect such close submissions.

Input

The input consists of at most 100 datasets, each in the following format.

s1
s2

Each of s1 and s2 is
a string written in a line, with the length between 1 and 200, inclusive.
They are the first and the second submitted programs respectively.

A program consists of lowercase letters (a, b, ..., z), uppercase letters (A, B, ..., Z),
digits (0, 1, ..., 9), double quotes ("), and semicolons (;).
When double quotes occur in a program, there are always even number of them.

The end of the input is indicated by a line containing one '.' (period).

Output

For each dataset, print the judge result in a line.

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.

Sample Input

print"hello";print123
print"hello";print123
read"B1input";solve;output;
read"B2";solve;output;
read"C1";solve;output"C1ans";
read"C2";solve;output"C2ans";
""""""""
"""42"""""
slow"program"
fast"code"
"super"fast"program"
"super"faster"program"
X""
X
I"S""CREAM"
I"CE""CREAM"
11"22"11
1"33"111
.

Output for the Sample Input

IDENTICAL
CLOSE
DIFFERENT
CLOSE
DIFFERENT
DIFFERENT
DIFFERENT
CLOSE
DIFFERENT



Sample input:
print"hello";print123
print"hello";print123
read"B1input";solve;output;
read"B2";solve;output;
read"C1";solve;output"C1ans";
read"C2";solve;output"C2ans";
""""""""
"""42"""""
slow"program"
fast"code"
"super"fast"program"
"super"faster"program"
X""
X
I"S""CREAM"
I"CE""CREAM"
11"22"11
1"33"111
.


Sample output:
IDENTICAL
CLOSE
DIFFERENT
CLOSE
DIFFERENT
DIFFERENT
DIFFERENT
CLOSE
DIFFERENT

Submission status: Runtime Error

Solution code:
results=[]
while True:
    a=input().split("\"")
    if a[0]==".":
        break
    b=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")

Submission status: Runtime Error

Solution code:
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")

Submission status: Runtime Error

Solution code:
results=[]
while 1:
    a=input().split("\"")
    if a[0]==".":
        break
    b=input().split("\"")
    count1=0
    count2=0
    for i in range(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")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:



while 1:
	list1=input().split('"')
	if len(list1)==1 and list1[0]=='.':
		break
	list2=input().split('"')
	
	cnt=0
	flag1=1
	flag2=0
	
	if len(list1)!=len(list2):
		flag1=0
	else:
		i=0
		while i<len(list1):
			if list1[i]==list2[i]:
			elif i%2==0:
				flag1=0
				flag2=1
				break
			else:
				cnt+=1
				
				if cnt>1:
					flag1=0
					break
			i+=1
	if flag1==0 and cnt==1 and flag2=0:
		print("CLOSE")
	elif flag==1:
		print("IDENTICAL")
	else:
		print("DEFFERENT")

Submission status: Runtime Error

Solution code:
while 1:
    list1=input().split('"')
    if len(list1)==1 and list1[0]==".":
        break
    list2=input().split('"')
     
    c1=0
    c2=0
    flag=0
     
    if len(list1)!=len(list2):
        print("DIFFERENT")
    else:
        i=0
        while i<len(list1):
            if list1[i]==list2[i]:
                c1+=1
            elif i%2==0:
                print("DIFFERENT")
                flag=1
                break
            else:
                c2+=1
                if c2>1:
                    print("DIFFERENT")
                    break
            i+=1
                 
        if flag==0 and t2==1:
            print("CLOSE")
        if c1==len(list1):
            print("IDENTICAL")

Submission status: Runtime Error

Solution code:
while 1:
    list1=input().split('"')
    if list1[0]==".":
        break
    list2=input().split('"')
     
    c1=0
    c2=0
    flag=0
     
    if len(list1)!=len(list2):
        print("DIFFERENT")
    else:
        i=0
        while i<len(list1):
            if list1[i]==list2[i]:
                c1+=1
            elif i%2==0:
                print("DIFFERENT")
                flag=1
                break
            else:
                c2+=1
                if c2>1:
                    print("DIFFERENT")
                    break
            i+=1
                 
        if flag==0 and t2==1:
            print("CLOSE")
        if c1==len(list1):
            print("IDENTICAL")

Submission status: Runtime Error

Solution code:
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(l >= n-1 or l+idx_dif >= m-1):
            flag = 2

        if(flag == 0):
            for i in range(l,n):
                if(a[i] == '\"'):
                    for j in range(l+idx_dif,m):
                        if(b[j] == '\"'):
                            if(a[l:i] == b[l+idx_dif:j]):
                                idx_dif = j-i
                                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
                    break
                if(flag != 0):
                    break

        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] != b[l+idx_dif:j]):
                                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):
            break
        if(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")

Submission status: Runtime Error

Solution code:
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(l >= n-1 or l+idx_dif >= m-1):
            flag = 2
 
        if(flag == 0):
            for i in range(l,n):
                if(a[i] == '\"'):
                    for j in range(l+idx_dif,m):
                        if(b[j] == '\"'):
                            if(a[l:i] == b[l+idx_dif:j]):
                                idx_dif = j-i
                                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
                    break
                if(flag != 0):
                    break
 
        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] != b[l+idx_dif:j]):
                                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):
            break
        if(l >= n-1 or l+idx_dif >= m-1 or error_cou == 2):
            break
 
    if(error_cou >= 2 or flag == 2):
        print("DIFFERENT")
    elif(error_cou == 1):
        print("CLOSE")
    elif(error_cou == 0):
        print("IDENTICAL")

Submission status: Runtime Error

Solution code:
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(l >= n-1 or l+idx_dif >= m-1):
            flag = 2

        if(flag == 0):
            for i in range(l,n):
                if(a[i] == '\"'):
                    #for j in range(l+idx_dif,m):
                        #if(b[j] == '\"'):
                            #if(a[l:i] == b[l+idx_dif:j]):
                    if(i+idx_dif < m):
                        if(a[l:i] == b[l+idx_dif:i+idx_dif]):
                            l = i+1
                            flag = 1
                    else:
                        flag = 2
                    break
                                #idx_dif = j-i
                                #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
                    break
                if(flag != 0):
                    break

        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] != b[l+idx_dif:j]):
                                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):
            break
        if(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")

Submission status: Runtime Error

Solution code:
import numpy as np
A1=[]
A2=[]
ans=[]
for i in range(100):
    cnt=0
    S1=input("プログラム1:")
    if S1=='.':
        break
    S2=input("プログラム2:")
    A1=S1.split('"')
    A2=S2.split('"')
    if len(A1)==len(A2):
        for j in range(len(A1)):
            if j%2!=0:
                if A1[j]!=A2[j]:
                    cnt=cnt+1
                else:
                    if A1[j]!=A2[j]:
                        cnt=cnt+10000
    else:
        cnt=cnt+10000
    if cnt>1:
        ans.append("DIFERENT")
    elif cnt==1:
        ans.append("CLOSE")
    else:
        ans.append("IDENTICAL")
for i in range(len(ans)):
    print(ans[i])

Submission status: Runtime Error

Solution code:
A1=[]
A2=[]
ans=[]
for i in range(100):
    cnt=0
    S1=input("プログラム1:")
    if S1=='.':
        break
    S2=input("プログラム2:")
    A1=S1.split('"')
    A2=S2.split('"')
    if len(A1)==len(A2):
        for j in range(len(A1)):
            if j%2!=0:
                if A1[j]!=A2[j]:
                    cnt=cnt+1
                else:
                    if A1[j]!=A2[j]:
                        cnt=cnt+10000
    else:
        cnt=cnt+10000
    if cnt>1:
        ans.append("DIFERENT")
    elif cnt==1:
        ans.append("CLOSE")
    else:
        ans.append("IDENTICAL")
for i in range(len(ans)):
    print(ans[i])

Submission status: Runtime Error

Solution code:
#16D8101014F 久留米 竜之介 Python3
#a=[]
while(True):
	i=0
	tmp=0
	a=input().split('"') 
	aL=a.len()
	b=input().split('"')
	bL=b.len()
	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

Submission status: Runtime Error

Solution code:
#16D8101014F 久留米 竜之介 Python3
#a=[]
while(True):
	i=0
	tmp=0
	a=input().split('"') 
	aL=len(a)
	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

Submission status: Runtime Error

Solution code:
#16D8101014F 久留米 竜之介 Python3
#a=[]
while(True):
	i=0
	tmp=0
	a=input().split('"') 
	aL=len(a)
	b=input().split('"')
	bL=len(b)
	if a[0]==".":
		break
		
	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