while True:

    s1 = input()

 

    if s1 == '.':

        break

 

    s2 = input()



    s1 = s1.split('"')

    s2 = s2.split('"')



    if s1 == s2:

        print("IDENTICAL")

 

    elif len(s1) != len(s2):

        print("DIFFERENT")



    else:

        cnt = 0

        for i in range(len(s1)):

            if s1[i] != s2[i] and i % 2 == 1:

                cnt += 1

            elif s1[i] != s2[i]:

                cnt += 2



        print("CLOSE" if cnt == 1 else "DIFFERENT")

def solve(s, t):

    s = s.split('"')

    t = t.split('"')



    if s == t:

        return "IDENTICAL"



    if len(s) == len(t):

        cnt = 0

        for i in range(len(s)):

            if s[i] != t[i] and i % 2 == 1:

                cnt += 1

            elif s[i] != t[i]:

                cnt += 2

        if cnt == 1:

            return 'CLOSE'



    return 'DIFFERENT'



while True:

    s1 = input()



    if s1 == '.': break



    s2 = input()



    print(solve(s1, s2))



while True:
    s1 = input()
    if s1 == ".":
        break
    s2 = input()
    s1 = s1.split('"')
    s2 = s2.split('"')
    if s1 == s2:
        print("IDENTICAL")
    elif len(s1) != len(s2):
        print("DIFFERENT")
    else:
        cnt = 0
        for i in range(len(s1)):
            if s1[i] != s2[i] and i % 2 == 1:
                cnt += 1
            elif s1[i] != s2[i]:
                cnt += 2
        print("CLOSE" if cnt == 1 else "DIFFERENT")

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


while True:
    s1 = input()
    if s1 == ".":
        break
    s2 = input()
    print(solve(s1, s2))

+def solve(s, t): +    s = s.split('"') +    t = t.split('"') +    if s == t: +        return "IDENTICAL" +    if len(s) == len(t): +        cnt = 0 +        for i in range(len(s)): +            if s[i] != t[i] and i % 2 == 1: +                cnt += 1 +            elif s[i] != t[i]: +                cnt += 2 +        if cnt == 1: +            return "CLOSE" +    return "DIFFERENT" + + -    s1 = s1.split('"') -    s2 = s2.split('"') -    if s1 == s2: -        print("IDENTICAL") -    elif len(s1) != len(s2): -        print("DIFFERENT") -    else: -        cnt = 0 -        for i in range(len(s1)): -            if s1[i] != s2[i] and i % 2 == 1: -                cnt += 1 -            elif s1[i] != s2[i]: -                cnt += 2 -        print("CLOSE" if cnt == 1 else "DIFFERENT") +    print(solve(s1, s2))