#include <stdio.h>
#include <string.h>

char prog1[201];
char prog2[201];


int chk_string(int *pos1, int *pos2)
{
    int res;
    
    (*pos1)++;
    (*pos2)++;
    
    res = 0;
    while (prog1[*pos1] != '\"'){
        if (res == 0){
            if (prog1[*pos1] != prog2[*pos2]){
                res = 1;
            }
            (*pos1)++;
            if (prog2[*pos2] != '\"'){
                (*pos2)++;
            }
            else {
                res = 1;
            }
        }
        else {
            (*pos1)++;
        }
    }
    if (prog2[*pos2] != '\"'){
        res = 1;
        while (prog2[*pos2] != '"'){
            (*pos2)++;
        }
    }
    return (res);
}


int main(void)
{
    int pos1, pos2;
    int result;
    
    while (1){
        scanf("%s", prog1);
        if (strcmp(prog1, ".") == 0){
            break;
        }
        scanf("%s", prog2);
        
        if (strcmp(prog1, prog2) == 0){
            printf("IDENTICAL\n");
            continue;
        }
        
        pos1 = pos2 = 0;
        result = 0;
        while (prog1[pos1] != '\0'){
            if (prog1[pos1] != prog2[pos2]){
                result = 2;
                break;
            }
            if (prog1[pos1] == '\"'){
                result += chk_string(&pos1, &pos2);
            }
            pos1++;
            pos2++;
        }
        if (prog2[pos2] != '\0'){
            result = 2;
        }
        
        if (result >= 2){
            printf("DIFFERENT\n");
        }
        else {
            printf("CLOSE\n");
        }
    }
    return (0);
}

