#include <stdio.h>

int main(void)
{
	char s1[201];
	char s2[201];
	int check = 0;
	int i = 0 , j = 0;
	int count = 0;
	int count2;


	while (1) {
		scanf("%s", s1);
		if (s1[0]== '.')
			break;
		else {
			scanf("%s", s2);
			while (1) {
				if (check == 1) {	/* ""?????? */
					count2 = count;
					i++;
					j++;
					/*printf("1 %c %c\n\n", s1[i], s2[j]);
					getchar();*/

					for (; s1[i] != '"' || s2[j] != '"'; ){
						if (s1[i] == s2[j]) {}
						else {
							count++;
						}
						if (s1[i] != '"')
							i++;
						if (s2[j] != '"')
							j++;
						/*printf("3 %c %c\n", s1[i], s2[j]);
						printf("4 %d\n", count);*/
					}
					/*printf("5 %d %d\n", i, j);
					printf("6 %c %c\n\n", s1[i], s2[j]);
					printf("7 %d\n", count); */
					i++;
					j++;
					check = 0;
					if (count2 < count)
						count = count2 + 1;
					if (count > 2)
						break;
				}
				else {	/* ""?????? */
					for (; s1[i] != '\0' || s2[j] != '\0'; i++, j++) {
						if (s1[i] != s2[j]) {
							count += 2;
							break;
						}
						else {
							if (s1[i] == '"' && s2[j] == '"') {
								check = 1;
								break;
							}
							else {}
						}
					}
					if (s1[i] != s2[j])
						break;
					if (s1[i] == '\0' && s2[j] == '\0')
						break;
				}
			}

			/* ?????? */
			if (count == 0)
				printf("IDENTICAL\n");
			else if (count == 1)
				printf("CLOSE\n");
			else
				printf("DIFFERENT\n");

			/* ????????? */
			count = 0;
			for (i = 0; s1[i] != '\0'; i++)
				s1[i] = '\0';
			for (i = 0; s1[i] != '\0'; i++)
				s1[i] = '\0';
			check = 0;
			i = 0;
			j = 0;

		}
	}

	return 0;
}