 while 1 do
  q=0
  s1=Array.new
  s2=Array.new
  s1=gets.split("\"")
  if s1[0]==".\n"&&s1.length==1 then 
    break
  end
  s2=gets.split("\"")
  if s1.length!=s2.length then 
    q=2 
  end
  s1.length.times do |i|
    if s1[i]!=s2[i] then
      if i%2==1&&q==0 then
        q=1
      else 
        q=2
        break
      end
    end
  end
  case q
  when 0 then print "IDENTICAL\n"
  when 1 then print "CLOSE\n"
  when 2 then print "DIFFERENT\n"
  end
end
