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

while 1:

    list1=input().split('"')

    if list1[0]==".":

        break

    list2=input().split('"')

     

    cnt1=0

    cnt2=0

    flag=0

     

    if len(list1)!=len(list2):

        print("DIFFERENT")

    else:

        i=0

        while i<len(list1):

            if list1[i]==list2[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(list1):

            print("IDENTICAL")



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

while 1:
    list1 = input().split('"')
    if list1[0] == ".":
        break
    list2 = input().split('"')
    cnt1 = 0
    cnt2 = 0
    flag = 0
    if len(list1) != len(list2):
        print("DIFFERENT")
    else:
        i = 0
        while i < len(list1):
            if list1[i] == list2[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(list1):
            print("IDENTICAL")

-    s1 = input().split('"') -    if s1[0] == ".": +    list1 = input().split('"') +    if list1[0] == ".": -    s2 = input().split('"') +    list2 = input().split('"') -    if len(s1) != len(s2): +    if len(list1) != len(list2): -        while i < len(s1): -            if s1[i] == s2[i]: +        while i < len(list1): +            if list1[i] == list2[i]: -        if cnt1 == len(s1): +        if cnt1 == len(list1):