#include <iostream>
#include <string>
#include <vector>
using namespace std;

int main(){

  while(true){
    int wrongTime = 0;
    string str_in;
    string str_ans;
    vector <string> sub_in;
    vector <string> sub_ans;
    //input--------------------
    cin >> str_in;
    if( str_in == ".") break;
    cin>> str_ans;
    //split---------------------
    int start = 0;
    for(int i=0; i < str_in.size() ; i++){
      if(str_in[i] == '\"') {
        sub_in.push_back(str_in.substr(start,i-start));
        start = i+1;
      }
    }
    sub_in.push_back(str_in.substr(start,str_in.size()-start));
    start = 0;
    for(int i=0; i < str_ans.size() ; i++){
      if(str_ans[i] == '\"') {
        sub_ans.push_back(str_ans.substr(start,i-start));
        start = i+1;
      }
    }
    sub_ans.push_back(str_ans.substr(start,str_ans.size()-start));
    //split check
      // for(int i = 0; i < sub_in.size(); i++) cout << sub_in[i] << endl;
      // for(int i = 0; i < sub_ans.size(); i++) cout << sub_ans[i] << endl;

    //conpare
    if(sub_in.size() != sub_ans.size()){
      wrongTime = 2;
    }else{
      wrongTime = 0;
      for(int i = 0; i < sub_in.size(); i++){
        if(i%2 == 1){
          if(sub_in[i] != sub_ans[i]) wrongTime ++;
        }else{
          if(sub_in[i] != sub_ans[i]) wrongTime += 2;
        }
      }
    }
    if(wrongTime == 0) cout << "IDENTICAL" << endl;
    else if(wrongTime <= 1) cout << "CLOSE" << endl;
    else cout << "DIFFERENT" << endl;
    sub_in.clear();
    sub_ans.clear();
  }

  return 0;
}

