#include<iostream>
#include<cstdio>
#include<vector>

#define REP(i,s,n) for(int i=s;i<n;++i)
#define rep(i,n) REP(i,0,n)

using namespace std;

const string Y = "IDENTICAL";
const string N = "DIFFERENT";
const string C = "CLOSE";

string elim(string s) {
  string ret = "";
  bool toggle = false;
  rep(i,(int)s.size()) {
    if( s[i] == '"' ) { 
      if( toggle ) ret += "@";
      toggle = !toggle;
      continue;
    }
    if( toggle ) continue;
    ret += s[i];
  }
  return ret;
}

vector<string> extr(string s) {
  vector<string> vec;
  bool toggle = false;
  string buf = "";
  rep(i,(int)s.size()) {
    if( s[i] == '"' ) {
      if( toggle ) {
	vec.push_back(buf);
	buf = "";
      }
      toggle = !toggle;
      continue;
    }
    if( !toggle ) continue;
    buf += s[i];
  }
  return vec;
}

int main() {
  string s,t;
  while( cin >> s, s[0] != '.' ) {
    cin >> t;
    if( s == t ) {
      puts(Y.c_str());
    } else if( elim(s) != elim(t) ) {
      puts(N.c_str());
    } else {
      vector<string> v1 = extr(s);
      vector<string> v2 = extr(t);
      int diff = 0;
      if( v1.size() != v2.size() ) {
	puts(N.c_str());
      } else {
	rep(i,(int)v1.size()) {
	  if( v1[i] != v2[i] ) {
	    ++diff;
	    continue;
	  }
	}
	( diff == 1 ) ? puts(C.c_str()) : puts(N.c_str());
      }
    }
  }
  return 0;
}