#include <iostream>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cctype>
#include <cstring>
#include <utility>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;

bool check(string s1,string s2){
    int l=0,r=0;
    int cnt=0;
    while(l<s1.size() || r<s2.size())
    {
        //if(s1.size()==l || s2.size()==r)return false;
        if(s1[l]!=s2[r])return false;
        if(s1[l]=='"')
        {
            l++;
            string ss="";
            while(s1[l]!='"')
            {
                ss+=s1[l];
                l++;
            }
            r++;
            string ss2="";
            while(s2[r]!='"')
            {
                ss2+=s2[r];
                r++;
            }
            l++;
            r++;
            if(ss!=ss2)
            {
                cnt++;
            }
        }
        else
        {
            l++;
            r++;
        }
    }
    return (l==s1.size() && r==s2.size() && cnt<=1);
}

int main()
{
    while(1){
        string s1,s2;
        cin >> s1;
        if(s1==".")break;
        cin >> s2;
        if(s1==s2){
            printf("IDENTICAL\n");
        }else{
            printf("%s\n",check(s1,s2)?"CLOSE":"DIFFERENT");
        }
    }
    return 0;
}

