#include <bits/stdc++.h>
#define pb push_back
using namespace std;

pair<vector<string>, vector<string>> extract(string s1) {
    vector<string> command1, str1;
    bool is_command = true;
    string s= "";
    for (char c : s1) {
        if (c == '"') {
            if (is_command) command1.pb(s);
            else str1.pb(s);
            s = "";
            is_command = !is_command;
            continue;
        }
        s += c;
    }
    if (is_command) command1.pb(s);
    else str1.pb(s);
    return make_pair(command1, str1);
}

int solve(string s1, string s2) {
    pair<vector<string>, vector<string>> verb1 = extract(s1);
    pair<vector<string>, vector<string>> verb2 = extract(s2);

    auto command1 = verb1.first;
    auto str1 = verb1.second;

    auto command2 = verb2.first;
    auto str2 = verb2.second;

    if (command1.size() != command2.size() && str1.size() != str2.size()) return 0;

    for (int i = 0; i < command1.size(); i++) {
        if (command1[i] != command2[i]) return 0;
    }

    int count = 0;
    for (int i = 0; i < str1.size(); i++) {
        if (str1[i] != str2[i]) count++;
    }

    if (count == 0) return 1;
    else if (count == 1) return 2;
    else return 0;
}

int main() {
    cin.tie(0);
    while (1) {
        string s1, s2;
        cin >> s1;
        if (s1 == ".") break;
        cin >> s2;
        int ans = solve(s1, s2);
        if (ans == 1) cout << "IDENTICAL" << endl;
        else if (ans == 0) cout << "DIFFERENT" << endl;
        else if (ans == 2) cout << "CLOSE" << endl;
    }
    return 0;
}
