while true
    s = []
    s[0] = gets.chomp
    break if s[0] == "."
    s[1] = gets.chomp

    answer = "DIFFERENT"
    if s[0] == s[1]
        answer = "IDENTICAL"
    else
        arr = [[], []]
        arr2 = ["", ""]
        s.each_with_index{|ss, i|
            str, flag = "", false
            ss.each_char{|c|
                if c == '"'
                    flag = !flag
                    if !flag
                        arr[i] << str 
                        str = ""
                    end
                    arr2[i] += c
                else
                    if flag
                        str += c
                    else
                        arr2[i] += c
                    end
                end
            }
        }
        if arr2[0] == arr2[1] && arr[0].length == arr[1].length
            n = 0
            arr[0].zip(arr[1]){|a, b| n += 1 if a != b}
            answer = "CLOSE" if n == 1
        end
    end
    puts answer
end
