#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
  string s,t;
  while(cin>>s,s!="."){
    cin>>t;
    if(s==t){
      cout<<"IDENTICAL"<<endl;
      continue;
    }
    string u,v;
    int n=s.size(),m=t.size();
    vector<string> vs,vt;
    for(int i=0;i<n;i++){
      if(s[i]=='\"'){
	u+=s[i];
	string x;
	i++;
	while(s[i]!='\"') x+=s[i++];
	vs.push_back(x);
	u+=s[i];
	continue;
      }
      u+=s[i];
    }
    for(int i=0;i<m;i++){
      if(t[i]=='\"'){
	v+=t[i];
	string x;
	i++;
	while(t[i]!='\"') x+=t[i++];
	vt.push_back(x);
	v+=t[i];
	continue;
      }
      v+=t[i];
    }
    if(u!=v||vs.size()!=vt.size()){
      cout<<"DIFFERENT"<<endl;
      continue;
    }
    int dif=0;
    for(int i=0;i<(int)vs.size();i++) dif+=(vs[i]!=vt[i]);
    if(dif==1){
      cout<<"CLOSE"<<endl;
      continue;
    }
    cout<<"DIFFERENT"<<endl;
  }
  return 0;
}