#include <bits/stdc++.h>
using namespace std;
using lint = long long;
template<class T = int> using V = vector<T>;
template<class T = int> using VV = V< V<T> >;

int main() {
  cin.tie(nullptr); ios::sync_with_stdio(false);
  while (true) {
    string s; cin >> s;
    if (s == ".") break;
    string t; cin >> t;
    auto fn = [](const string& s) -> pair< string, V<string> > {
      bool b = false;
      pair< string, V<string> > res;
      string curr;
      for (char c : s) {
        if (c == '"') {
          if (b) {
            res.first += '#';
            res.second.push_back(curr);
            curr = "";
          }
          b ^= true;
        } else {
          (b ? curr : res.first) += c;
        }
      }
      return res;
    };
    auto a = fn(s), b = fn(t);
    if (a == b) cout << "IDENTICAL\n";
    else if (a.first != b.first) cout << "DIFFERENT\n";
    else {
      bool f = true;
      if (a.second.size() != b.second.size()) f = false;
      int c = 0;
      if (f) {
        for (int i = 0; i < (int)a.second.size(); ++i) {
          c += a.second[i] != b.second[i];
        }
        if (c != 1) f = false;
      }
      cout << (f ? "CLOSE\n" : "DIFFERENT\n");
    }
  }
}
