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

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;

#define fi first
#define se second
#define repl(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define rep(i,n) repl(i,0,n)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl
#define mmax(x,y) (x>y?x:y)
#define mmin(x,y) (x<y?x:y)
#define maxch(x,y) x=mmax(x,y)
#define minch(x,y) x=mmin(x,y)
#define uni(x) x.erase(unique(all(x)),x.end())
#define exist(x,y) (find(all(x),y)!=x.end())
#define bcnt __builtin_popcount

#define INF 1e16
#define mod 1000000007

string s[2];

int main(){
  while(1){
    cin>>s[0];
    if(s[0]==".")break;
    cin>>s[1];
    vector<string> ss[2];
    rep(k,2)for(int i=0;i<s[k].size();){
      string tmp="";
      while(i<s[k].size()&&s[k][i]!='\"'){
        tmp+=s[k][i];
        i++;
      }
      ss[k].push_back(tmp);
      i++;
    }
    if(ss[0].size()!=ss[1].size()){
      cout<<"DIFFERENT"<<endl;
    }else{
      bool ok=true;
      int cnt=0;
      rep(i,ss[0].size()){
        if(i%2==0){
          if(ss[0][i]!=ss[1][i])ok=false;
        }else{
          if(ss[0][i]!=ss[1][i])cnt++;
        }
      }
      if(ok&&cnt==0)cout<<"IDENTICAL"<<endl;
      else if(ok&&cnt==1)cout<<"CLOSE"<<endl;
      else cout<<"DIFFERENT"<<endl;
    }
  }
  return 0;
}

