#include<bits/stdc++.h>
using namespace std;

int foo(vector<string> s[], vector<string> t[]){
  if(s[0].size() != t[0].size() || s[1].size() != t[1].size())return false;
  //  cout<<s[0].size()<<" "<<t[0].size()<<" "<<s[1].size()<<" "<<t[1].size()<<endl;
  for(int i = 0; i < s[0].size(); i++){
    if(s[0][i] != t[0][i])return false;
  }
  for(int i = 0, count = 0; i < s[1].size(); i++){
    if(s[1][i] != t[1][i]){
      count++;
      if(count == 2)return false;
    }
  }
  return true;
}

int main(){
  while(true){
    string s1, s2, temp;
    vector<string> s[2], t[2];
    cin>>s1;

    if(s1 == ".")break;
    
    cin>>s2;

    if(s1==s2){cout<<"IDENTICAL"<<endl; continue;}
 
    for(int i = 0,f=0; i < s1.size(); i++){
      if(s1[i] == '"'|| i == s1.size()-1){
	s[f].push_back(temp);
	f = !f;
	temp.clear();
	temp+="a";
      }else temp += s1[i];
    }
    temp.clear();
    for(int i = 0,f=0; i < s2.size(); i++){
      if(s2[i] == '"'|| i == s2.size()-1){
	t[f].push_back(temp);
	f = !f;
	temp.clear();
	temp+="a";
      }else temp += s2[i];
    }

    cout<<(foo(s,t)?"CLOSE":"DIFFERENT")<<endl;;
  }
  return 0;
}

