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

int main(void) {
	char str1[201], str2[201];
	int flag;
	int i, j, count;

	while(1) {
		scanf("%s", str1);
		if(str1[0] == '.' && str1[1] == '\0') break;
		scanf("%s", str2);

		if(strcmp(str1, str2) == 0){
			printf("IDENTICAL\n");
			continue;
		}

		flag = false;
		i = j = count = 0; 
		while(str1[i] != '\0' || str2[j] != '\0') {
			if(str1[i] != str2[j]) {
				if(flag == false) {
					count = 2;
					break;
				} else{
					if(++count >= 2) break;
					flag = false;
					while(str1[i] != '"') i++;
					while(str2[j] != '"') j++;
				}
			} else if(str1[i] == '"' && str2[j] == '"') {
				flag = !flag;
			}
			i++; j++;
		}//endwhile

		if(count == 1){
			printf("CLOSE\n");
		} else{
			printf("DIFFERENT\n");
		}

	}//endwhile
	return 0;
}
