def diff(a, b, i = 0)
    return 2 if a.size != b.size
    return 0 if i >= a.size
    if a[i][0] == ?"
        if a[i] == b[i]
            return diff(a, b, i+1)
        elsif b[i][0] != ?"
            return 2
        else
            return 1 + diff(a, b, i+1)
        end
    else
        return a[i] == b[i] ? diff(a, b, i+1) : 2
    end
end
f = -> { gets.chomp.scan(/[^"]+|"[^"]*"/) }
loop do
    a = f[]
    break if a == ["."]
    b = f[]
    case diff(a, b)
    when 0
        puts 'IDENTICAL'
    when 1
        puts 'CLOSE'
    else
        puts 'DIFFERENT'
    end
end

