import std.algorithm;
import std.array;
import std.ascii;
import std.container;
import std.conv;
import std.math;
import std.numeric;
import std.range;
import std.stdio;
import std.string;
import std.typecons;
void log(A...)(A arg) { stderr.writeln(arg); }
int size(T)(in T s) { return cast(int)s.length; }

void main() {
    bool solve() {
        auto s = readln.chomp;
        if (s == ".") return false;
        auto t = readln.chomp;
        if (s == t) {
            writeln("IDENTICAL");
            return true;
        }
        auto ss = s.split("\"").array;
        auto ts = t.split("\"").array;
        if (ss.length != ts.length) {
            writeln("DIFFERENT");
            return true;
        }
        foreach (int i, x; ss) {
            if (i % 2 != 0) continue;
            if (x != ts[i]) {
                writeln("DIFFERENT");
                return true;
            }
        }
        int c = 0;
        foreach (int i, x; ss) {
            if (i % 2 == 0) continue;
            c += (x != ts[i]);
        }
        writeln(c == 1 ? "CLOSE" : "DIFFERENT");
        return true;
    }
    while (solve()) {}
}