#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <climits>
#include <vector>
#include <map>
#include <set>
#include <list>
#include <stack>
#include <queue>
#include <algorithm>
#include <iostream>
#include <string>

#define REP(i,n) for(long long i=0;i<n;++i)
#define REPR(i,n) for(long long i=n;i>=0;--i)
#define REPI(itr,v) for(auto itr=v.begin();itr!=v.end();++itr)
#define REPIR(itr,v) for(auto itr=v.rbegin();itr!=v.rend();++itr)
#define FOR(i,a,b) for(long long i=a;i<b;++i)
#define SORT(v,n) sort(v, v+n)
#define SORTV(v) sort(v.begin(), v.end())
#define ALL(v) v.begin(),v.end()
#define llong long long
#define INF 999999999
#define MOD 1000000007
#define pb push_back
#define pf push_front
#define MP make_pair
#define SV(v) {for(long long sitr=0;sitr<v.size();++sitr){cin>>v[sitr];}}

int dx[] = {0, 0, -1, 1};
int dy[] = {1, -1, 0, 0};

using namespace std;

typedef pair<int,int> pii;

int main(){

  while(true){
    string s1, s2;
    cin >> s1;
    if(s1 == ".") break;

    cin >> s2;

    if(s1 == s2){
      cout << "IDENTICAL\n";
    }else{

      vector<string> c, d;
      int ii = 0;
      REP(i,s1.length()){
        if(s1[i] == '"'){
          c.pb(s1.substr(ii, i - ii));
          int j = i + 1;
          while(true){
            if(s1[j] == '"'){
              ii = j+1;
              i = j;
              break;
            }
            j++;
          }
        }
      }
      
      c.pb(s1.substr(ii, s1.length() - ii));

      ii = 0;
      REP(i,s2.length()){
        if(s2[i] == '"'){
          d.pb(s2.substr(ii, i - ii));
          int j = i + 1;
          while(true){
            if(s2[j] == '"'){
              ii = j+1;
              i = j;
              break;
            }
            j++;
          }
        }
      }
      d.pb(s2.substr(ii, s2.length() - ii));



      if(c.size() != d.size()){
        cout << "DIFFERENT\n";
        continue;
      }

      bool end = false;
      REP(i,c.size()){
        if(c[i] != d[i]){
          cout << "DIFFERENT\n";
          end = true;
          break;
        }
      }
      if(end) continue;


      vector<string> a, b;
      REP(i,s1.length()){
        if(s1[i] == '"'){
          int j = i + 1;
          while(true){
            if(s1[j] == '"'){
              if(j - i != 1){
                string tmp = s1.substr(i+1, j - i - 1);
                a.pb(tmp);
              }else{
                a.pb("");
              }
              break;
            }
            j++;
          }
          i = j;
        }
      }
      REP(i,s2.length()){
        if(s2[i] == '"'){
          int j = i + 1;
          while(true){
            if(s2[j] == '"'){
              if(j - i != 1){
                string tmp = s2.substr(i+1, j - i - 1);
                b.pb(tmp);
              }else{
                b.pb("");
              }
              break;
            }
            j++;
          }
          i = j;
        }
      }

      if(a.size() == b.size()){
        int cnt = 0;
        bool f = true;
        REP(i,a.size()){
          if(a[i] != b[i]){
            cnt++;
            if(cnt == 2){
              f = false;
              break;
            }
          }
        }

        if(f){
          cout << "CLOSE\n";
        }else{
          cout << "DIFFERENT\n";
        }
      }else{
        cout << "DIFFERENT\n";
      }


    }
  }
  return 0;
}




Measured memory_bytes: 3032