#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
string s1, s2;

int main() {

  while (1) {
    int count = 0;
    int n1 = 0;
    int n2 = 0;
    int error = 0;

    cin >> s1;
    if(s1 == ".") break;
    cin >> s2;

    if(s1 == s2) {
      cout << "IDENTICAL" << endl;
      continue;
    }

    while(1) {
      if(s1[n1] == '"' && s2[n2] == '"') {
        n1++; n2++;
        count = 0;
        while(1) {
          if (s1[n1] == '"' && s2[n2] == '"') {
            if(count > 0) error++;
            break;
          }
          if (s1[n1] != s2[n2]) count++;
          if(s1[n1] != '"') n1++;
          if(s2[n2] != '"') n2++;
        }
      }
      else if(s1[n1] != s2[n2]) {
        cout << "DIFFERENT" << endl;
        break;
      }
      if(n1 != s1.size()) n1++;
      if(n2 != s2.size()) n2++;
      if(n1 == s1.size() && n2 == s2.size())  {
        if (error >= 2 ) {
          cout << "DIFFERENT" << endl;
          break;
        }
        else {
          cout << "CLOSE" << endl;
          break;
        }
      }
    }
  }

  return 0;
}

