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

int main()
{
  while (1){
    char str1[200],str2[200];
  enum{
      IDENTICAL,
      CLOSE,
      DIFFERENT
    };

    fgets(str1,sizeof(str1),stdin);

    char check_if_input_ends = str1[0];

    if (check_if_input_ends == '.'){
      return 0;
    }

    fgets(str2,sizeof(str2),stdin);
    
    int judged = 0;
    int quote_cnt_changed = 0,double_quote_cnt = 0;
    int program_difference = 0,file_name_difference = 0;
    int i = 0,j = 0;

    while (str1[i] != '\0' || str2[j] != '\0'){
      if(quote_cnt_changed == 1){
        while (str1[i] != '"'){
          i++;
        }
        while (str2[j] != '"'){
          j++;
        }
      }
      if (str1[i] == '"' || str2[j] == '"'){
        if (str1[i] == '"' && str2[j] == '"'){
        } else if (str1[i] != '"'){
          if (double_quote_cnt % 2 == 0){
            program_difference++;
          } else {
            file_name_difference++;
          }
          while (str1[i] != '"'){
            i++;
          }
        } else {
          if (double_quote_cnt % 2 == 0){
            program_difference++;
          } else {
            file_name_difference++;
          }
          while (str2[j] != '"'){
            j++;
          }
        }
        double_quote_cnt++;
        quote_cnt_changed = 0;
      }

      if (double_quote_cnt % 2 == 0){
        if (str1[i] != str2[j] || program_difference > 0){
          printf("%s\n","DIFFERENT");
          judged++;
          break;
        }
      } else {
        if (str1[i] != str2[j] && quote_cnt_changed == 0){
          file_name_difference++;
          quote_cnt_changed++;
        }
      }
      i++;
      j++;
    }

    if (judged > 0){
      continue;
    }

    switch (file_name_difference){
      case IDENTICAL:
        printf("%s\n","IDENTICAL");
        break;
      case CLOSE:
        printf("%s\n","CLOSE");
        break;
      default:
        printf("%s\n","DIFFERENT");
        break;
    }
  }
  return 0;
}

